Home forums Using CanvasJS multiple data-points sources

This topic contains 2 replies, has 2 voices, and was last updated by  umustaphax 3 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4903

    umustaphax
    Participant

    HI ,
    i want to draw one dynamic real time chart with multiple data-points sources is that possible?i just want to see one chart and switch between them. i mean that.

    data: [{ 
    				// dataSeries1
    				type: "line",
    				xValueType: "dateTime",
    				showInLegend: true,
    				name: "Company A",
    				dataPoints: dataPointsi1
    			},
    			{				
    				// dataSeries2
    				type: "line",
    				xValueType: "dateTime",
    				showInLegend: true,
    				name: "Company B" ,
    				dataPoints: dataPointsi2
    			} ,
    			{				
    				// dataSeries3
    				type: "line",
    				xValueType: "dateTime",
    				showInLegend: true,
    				name: "Company C" ,
    				dataPoints: dataPointsi3
    			}]
                        
    if(ii==1) // ii variable take 0 or 1
    			{    
    		 dataPointsi1 = dataPoints1;
    		 dataPointsi2 = dataPoints2;
             dataPointsi3 = dataPoints3;}
    		 else if(ii==0) 
    		 { 
    		 dataPointsi1 = dataPoints4;
    		 dataPointsi2 = dataPoints5;
             dataPointsi3 = dataPoints6;}

    thank you.

    #4916

    Sunil Urs
    Keymaster

    You can do something like

    chart.options.data[0].dataPoints = dataPoints1; //assign dataPoints2 to switch to another one.

    #4920

    umustaphax
    Participant

    thank you very much

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.