Home forums Using CanvasJS chart tooltip: hide undefined

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Priyanka M S 3 weeks, 6 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #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 3 weeks, 6 days ago by  pancakestacks.
    #23184

    Priyanka M S
    Member

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