gpt4 book ai didi

javascript - Amcharts 与 Oracle

转载 作者:行者123 更新时间:2023-12-03 03:25:06 25 4
gpt4 key购买 nike

我尝试用 oracle 制作图表,但遇到一些问题: https://www.amcharts.com/demos/stacked-column-chart/ 我的查询给出了这个结果:

 {
"number_status": "20",
"status": "IN PROGRESS",
"child_creator": "pasternok"
}, {
"number_status": "2",
"status": "DELAYED",
"child_creator": "kropep"
}, {
"number_status": "1",
"status": "SOLVED",
"child_creator": "kropep"
}, {
"number_status": "13",
"status": "IN PROGRESS",
"child_creator": "Kaess"
}, {
"number_status": "3",
"status": "ON HOLD",
"child_creator": "hutapeap"
}, {
"number_status": "1",
"status": "REJECTED",
"child_creator": "dmeury"
}, {
"number_status": "10",
"status": "IN PROGRESS",
"child_creator": "Lins"
}, {
"number_status": "1",
"status": "ON HOLD",
"child_creator": "zuerni"
}, {

我想让 child_creator 位于底部,就像教程中的那样右侧应该是所有状态。

最佳答案

至少必须将数据格式化为如下所示:

[{
"IN PROGRESS": 20,
"child_creator": "pasternok"
}, {
"SOLVED": 1,
"DELAYED": 2,
"child_creator": "kropep"
}, {
"IN PROGRESS": 13,
"child_creator": "Kaess"
}, {
"ON HOLD": 3,
"child_creator": "hutapeap"
}, {
"REJECTED": 1,
"child_creator": "dmeury"
}, {
"IN PROGRESS": 10,
"child_creator": "Lins"
}, {
"ON HOLD": 1,
"IN PROGRESS": 3,
"child_creator": "zuerni"
}]

那就试试这个 http://jsfiddle.net/tamvo/ne6u0zhu/

var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"legend": {
"horizontalGap": 10,
"maxColumns": 1,
"position": "right",
"useGraphSettings": true,
"markerSize": 10
},
"dataProvider": [{
"IN PROGRESS": 20,
"child_creator": "pasternok"
}, {
"SOLVED": 1,
"DELAYED": 2,
"child_creator": "kropep"
}, {
"IN PROGRESS": 13,
"child_creator": "Kaess"
}, {
"ON HOLD": 3,
"child_creator": "hutapeap"
}, {
"REJECTED": 1,
"child_creator": "dmeury"
}, {
"IN PROGRESS": 10,
"child_creator": "Lins"
}, {
"ON HOLD": 1,
"IN PROGRESS": 3,
"child_creator": "zuerni"
}],
"valueAxes": [{
"stackType": "regular",
"axisAlpha": 0.3,
"gridAlpha": 0
}],
"graphs": [{
"balloonText": "<b>[[title]]</b><span style='font-size:14px'>: <b>[[value]]</b></span>",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "IN PROGRESS",
"type": "column",
"color": "#000000",
"valueField": "IN PROGRESS"
}, {
"balloonText": "<b>[[title]]</b><span style='font-size:14px'>: <b>[[value]]</b></span>",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "SOLVED",
"type": "column",
"color": "#000000",
"valueField": "SOLVED"
}, {
"balloonText": "<b>[[title]]</b><span style='font-size:14px'>: <b>[[value]]</b></span>",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "DELAYED",
"type": "column",
"color": "#000000",
"valueField": "DELAYED"
}, {
"balloonText": "<b>[[title]]</b><span style='font-size:14px'>: <b>[[value]]</b></span>",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "ON HOLD",
"type": "column",
"color": "#000000",
"valueField": "ON HOLD"
}, {
"balloonText": "<b>[[title]]</b><span style='font-size:14px'>: <b>[[value]]</b></span>",
"fillAlphas": 0.8,
"labelText": "[[value]]",
"lineAlpha": 0.3,
"title": "REJECTED",
"type": "column",
"color": "#000000",
"valueField": "REJECTED"
}],
"categoryField": "child_creator",
"categoryAxis": {
"gridPosition": "start",
"axisAlpha": 0,
"gridAlpha": 0,
"position": "left"
},
"export": {
"enabled": true
}
});

关于javascript - Amcharts 与 Oracle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46365299/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com