Home forums Using CanvasJS RangeColumn & IndexLabel – only one value on top of Y

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 1 month, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13048

    tbraida
    Member

    Hi,

    I’m using the RangeColumn and trying to set the IndexLabel.

    I read the topic and there is:

    Range Charts have two indexLabels – one for each y value

    I would like to show only one time! Show on top of Y. Is this possible?

    Thanks from Brazil!

    var chart = new CanvasJS.Chart("chartContainer",
    	{
    		animationEnabled: true,
    		title:{
    			text: "Total Stores",
    		},
    		exportEnabled: false,
    		axisY: {
    			includeZero:false,
    			
    		},     
    		axisX: {
    			interval:1,
    		},
    		data: [
    		{
    			type: "rangeColumn",
    			bevelEnabled: false,
    			indexLabel: "{y}",
    			indexLabelFormatter: function(e){
                
    			if( e.index === 1)
    				return e.dataPoint.y[1];
    			else
    				return " ";
    		},
    			dataPoints: [   // Y: [Low, High]
    				{y:[0, 36],label: "Total variance",indexLabel: "SHOW THIS TEXT ON TOP"},
    				{y:[28, 36],label: "Year"},
    				{y:[27, 28],label: "Quarter"},
    				{y:[6, 27],label: "Manager"},
    				{y:[0, 6],label: "Store attributes"},	
    			]
    		}
    		]
    	});
    • This topic was modified 1 month, 1 week ago by  tbraida.
    #13050

    Vishwas R
    Keymaster

    @tbraida,

    indexLabel and indexLabelFormatter at dataSeries will be overridden by indexLabel and indexLabelFormatter at dataPoint level. Assigning indexLabelFormatter at dataPoint level will work in your case.


    Vishwas R

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

You must be logged in to reply to this topic.