I have a chart in my side nav and I want to show some data on the chart, but when I used the variable it said that the variable is undefined
. I used the https://www.zingchart.com/ library for my chart. I want to know what should I do to set the my value in the chart.
here is my code:
const a = 100;
const b = 200;
var myConfig = {
"type": "funnel",
"scale-y": {
"placement": "opposite",
"labels": ["Arash", "Trial Downloads", "Quote Requests", "Sales", "Renewals"],
"item": {
"font-color": "#999999",
"font-family": "Georgia"
}
},
"plot": {
"value-box": {
"text": "%v",
"placement": "left-out", //"auto"/"in", "top", "bottom", "left", "right", "left-out", or "right-out"
"font-color": "gray",
"font-family": "Georgia",
"font-size": 12,
"font-weight": "normal"
},
"min-exit": "10%",
"hover-state": {
"background-color": "purple",
"border-color": "gray",
"border-width": 3,
"line-style": "dashdot"
}
},
"series": [{
"values": [a],
"text": "Arash-arash",
"background-color": "red"
},
{
"values": [b],
"text": "arash2",
"background-color": "orange"
},
{
"values": [90],
"text": "Quote Requests",
"background-color": "yellow"
},
{
"values": [30],
"text": "Sales",
"background-color": "green"
},
{
"values": [15],
"text": "Renewals",
"background-color": "blue"
}
]
};
zingchart.render({
id: 'myChart',
data: myConfig,
height: "100%",
width: "100%"
});
question from:
https://stackoverflow.com/questions/65901355/how-can-i-used-a-variable-inside-the-chart-the-chart-gets-the-values-in-json-f 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…