Sofiane Sofiane - 24 days ago 7
Javascript Question

Amcharts with oracle

I'm try to make chart with oracle but I've some problems with this:
https://www.amcharts.com/demos/stacked-column-chart/
my query give this results:

{
"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"
}, {


I wanna make the child_creator on bottom like on tutorial is years
and on right side should be all status.

vnt vnt
Answer Source

just must at least format your data to look like these:

[{
    "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"
}]

Then try this 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
    }
});