This topic contains 10 replies, has 2 voices, and was last updated by  Ashish Jindal 3 years, 10 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #8839

    xanadu
    Member

    Wijmo Subscriber

    Hi guys!

    Is it possible to set chartLabelFormatString depending on value? For example if value > 1 then ‘n1’ else ‘n3’ (I would like to display values with greater precision only on values < 1).

    #8884

    Ashish Jindal
    Moderator

    Hello Xanadu,

    Kindly check the attached sample wherein ChartLabels having value greater than 20 are displayed as ‘n1’ and rest are displayed as ‘n3’.

    Regards

    #8915

    xanadu
    Member

    Wijmo Subscriber

    Ashish Jindal, this is great, how to use it with compositechart (I’ve got bar chart on it)?

    #8916

    Ashish Jindal
    Moderator

    Hello Xanadu,

    Here is the sample using Bar chart in Composite chart.

    Regards

    #8918

    xanadu
    Member

    Wijmo Subscriber

    Ashish Jindal, works like a charm, big thanks 🙂

    #9040

    xanadu
    Member

    Wijmo Subscriber

    I’ve got one additional question:
    When following code should be invoked if I’m using knockout syntax for compositechart?

    //get the chartlabels
                var _chartLabels = $(“#wijcompositechart”).wijcompositechart().data().fields.chartElements.chartLabels;
    
                $.each(_chartLabels, function (index, elem) {
    
                    if (elem.attrs.text > 20) {
                        var originalValue = elem.attrs.text;
                        var newVal = parseFloat(originalValue).toFixed(1);
                        elem.attr(‘text’, newVal);
                    }
    
                });
    
    #9107

    xanadu
    Member

    Wijmo Subscriber

    Any ideas? 🙂

    #9451

    xanadu
    Member

    Wijmo Subscriber

    When I’m doing:

    <div data-bind="wijcompositechart:
            {
                [...]
            }"
    >
    

    and invoking following code after ko.applyBinding():

    //get the chartlabels
                var _chartLabels = $(“#wijcompositechart”).wijcompositechart().data().fields.chartElements.chartLabels;
    
                $.each(_chartLabels, function (index, elem) {
    
                    if (elem.attrs.text > 20) {
                        var originalValue = elem.attrs.text;
                        var newVal = parseFloat(originalValue).toFixed(1);
                        elem.attr(‘text’, newVal);
                    }
    
                });
    

    Labels are redrawed but on seriesList change :/

    #9520

    xanadu
    Member

    Wijmo Subscriber

    There was some problem when sending first part of code, so I’m sending it second time.

    <div id="@id"
            data-bind="wijcompositechart:
            {
                 ...
            }"
            >
    
    #9521

    xanadu
    Member

    Wijmo Subscriber

    I don’t know why I can’t send it…

    #9522

    Ashish Jindal
    Moderator

    Hello Xanadu,

    I would suggest you post a small sample replicating the issue so that I can check and can assist you accordingly.

    Regards

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

You must be logged in to reply to this topic.