jQWidgets Forums

jQuery UI Widgets Forums Chart Numeric legend values

This topic contains 2 replies, has 2 voices, and was last updated by  Billl 7 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Numeric legend values #96650

    Billl
    Participant

    I have a case where I want to show a bar chart with a single stacked bar. The bar chart is nothing fancy but it shows version numbers of a product. e.g. 1.5, 2.0, etc.. In the chart I want to show how many installations are using each version. Something like this data:

    var sampleData = [{ 1.5:30, 2.0:15, 2.5: 25 }];

    I can’t seem to get the legend labels to show if the field is numeric. The dataFields match the version numbers above and the bar segments display properly. If I were to add a letter to one of the versions (e.g. 1.5V or V1.5) then that legend label would show. displayText only works for non-numerics. Tooltips work find and show the bar series segment regardless of whether the legend shows the value or not.

    Is there an easy workaround for this, other than adding some text to the label?

    Numeric legend values #96655

    Stanislav
    Participant

    Hello Bill,

    You can read through this post:
    https://www.jqwidgets.com/community/topic/adding-custom-data-to-legend/

    Best Regards,
    Stanislav

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

    Numeric legend values #96673

    Billl
    Participant

    That worked. Thank you Stanislav!

    For my case I just returned the following from the legendFormatFunction:

    return value;

    This fixed it for versions in short format like 1.2 and longer ones like 1.2.3.4

    Bill

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

You must be logged in to reply to this topic.