Home Forums Chart Support chart tooltip: hide undefined

chart tooltip: hide undefined

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

    Hi,

    I’m looking to hide undefined sections in my tooltips.

    Since one of the categories is an unique serial number, and not all products have one, I have many undefined values.

    Example of issue
    Example of issue

    I was wondering what code should I input. I currently have:

    	toolTip: {
    		animationEnabled: false,
    		backgroundColor: "white",
    	
    			var label = "";
    			var content = " ";
    			for (var i = 0; i < e.entries.length; i++) {
    				content += "x:" + e.entries[i].dataPoint.x + "VP" + e.entries[i].dataPoint.y + " " + e.entries[i].dataPoint.serial_number;
    			}
    • This topic was modified 5 years, 6 months ago by pancakestacks.
    #23184

    @pancakestacks,

    You can add a condition to check if the category serial_number is present in toolTip contentFormatter. Please take a look at this jsfiddle.

    __
    Priyanka M S
    Team CanvasJS

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

You must be logged in to reply to this topic.