You must be logged in to post your query.
Home › Forums › Report Bugs › line chart: new line not visible on pushing dataseries
Tagged: Dataseries
I am trying to add new dataSeries using this: var newseries={ type:”line”, dataPoints:[ {y:frustrated[0],x:’1′,indexLabel:'{y}%’}, {y:frustrated[1],x:’2′, indexLabel:'{y}%’}, {y:frustrated[2],x:’3′, indexLabel:'{y}%’}] } chart.options.data.push(newseries); chart.render(); here frustrated array contains three float values which i got from ajax response. Problem is that the data is being pushed into the data array but i can only see tooltips corresponding to the new line, not the line….
I’ve tried changing it to a column chart… again on adding new data columns get shifted and all but the new columns are not visible.
@akshay30498,
It seems like you are passing invalid x-values to chart. Passing valid number to x-value of dataPoint should work fine in your case. If this doesn’t solve your requirement, please share a jsfiddle so that we can understand your requirement better and help you out.
__ Priyanka M S Team CanvasJS
I have used this: axisX:{ valueFormatString: ‘Test #’, interval:1, maximum:3.5 } So as far as x values are concerned they are fine…. because it is showing the chart with Test 1 Test 2 and Test 3 on X-axis its only so that assigning a new variable to datapoints doesn’t show the line… like i said tooltips are visible.
PS: I am using https://cdnjs.cloudflare.com/ajax/libs/canvasjs/1.7.0/canvasjs.min.js
Can you kindly share a jsfiddle with sample data, so that we can look at your code, understand and help you out? We recommend you to use latest version of CanvasJS.
hey!!! the “frustrated” array actually contained string “20”, “25” and “30” just thought about it while creating the fiddle So i used parseInt() around it and it showed line. What a noob mistake XD XD
Anyways now it is working ^_^ yeye!!! thanx for the help tho :)
Also about new version… why don’t u guys have a cdn for latest version? i don’t like downloading stuff … so i use cdn and latest cdn is for version 1.7.0 can u plz host the latest version on a cdn….
Glad that it’s working fine now.
Instead of CDN, you can serve CanvasJS script from https://cdn.canvasjs.com/canvasjs.min.js
You must be logged in to reply to this topic. Login/Register