Home Forums Chart Support RangeColumn & IndexLabel – only one value on top of Y

RangeColumn & IndexLabel – only one value on top of Y

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

    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 7 years, 5 months ago by tbraida.
    #13050

    @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.