You must be logged in to post your query.
Home › Forums › Chart Support › Dynamically parse 2 separate JSON outputs for the same chart
I have a php file getjson.php that can generate 2 different json outputs from a SQL query based on the GET variables with a startDate and EndDate, for example:
getjson.php – returns all values without date range in this format {“column1”: 123, “column2”: 456, “column3”: 789}
getjson.php?startDate=YYYY-MM-DD&EndDate=YYYY-MM-DD – returns values in specific date range in the same format as the previous one
The problem is when I try to load 2 chart variables that support 2 different dataPoints for the same chart and this cause a conflict of chart rendering
Take a look at my JSFiddle: https://jsfiddle.net/cy6zxhnp/
SOLVED!
I’ve solved it by cleaning the arrays before parsing JSON outputs inside the dropdown menu
@marco1987,
You will have to create a separate chart container with a unique id for each chart. You can use the CSS display property to hide/unhide a chart based on the option selected from the dropdown menu.
Please take a look at this JSFiddle for a working example.
— Thangaraj Raman Team CanvasJS
You must be logged in to reply to this topic. Login/Register