jQWidgets Forums

jQuery UI Widgets Forums Chart Pie Chart Custom Tooltip Field

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Pie Chart Custom Tooltip Field #28265

    charty
    Member

    Hi, I want to know how I can set the tooltip value to be a different field value in a Pie Chart.
    I have the following code which makes an array of JS objects with 3 properties.
    2 are used for the pie chart. I want the 3rd field (FieldForTooltip) to be the value displayed in the tooltip.
    How can I achieve this?

    var pieChartData = [
    {MobileBrowser:"IE", SharePercentage:"20", FieldForTooltip:"5500A"},
    {MobileBrowser:"Chrome", SharePercentage:"80", FieldForTooltip:"15500G"}
    ]
    //prepare chart settings
    var settings = {
    title: "",
    description: "",
    enableAnimations: true,
    showLegend: true,
    showBorderLine: false,
    legendLayout: { left: 500, top: 140, width: 300, height: 200, flow: 'vertical' },
    padding: { left: 5, top: 5, right: 5, bottom: 5 },
    titlePadding: { left: 0, top: 0, right: 0, bottom: 10 },
    source: pieChartData,
    colorScheme: 'scheme03',
    seriesGroups:
    [
    {
    type: 'pie',
    showLabels: true,
    series:
    [
    {
    dataField: 'SharePercentage',
    displayText: 'MobileBrowser',
    labelRadius: 120,
    initialAngle: 15,
    radius: 95,
    centerOffset: 0,
    formatSettings: { sufix: '%', decimalPlaces: 1 }
    }
    ]
    }
    ]
    };
    Pie Chart Custom Tooltip Field #28315

    Peter Stoev
    Keymaster

    Hi charty,

    For custom Tooltip Formatting, see: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxchart/javascript_chart_tooltips_formatting.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.