WelcomeForumsCommunityWijmo 3chartLabelFormatString

Wijmo Team Member
xanadu posted on November 5, 2012 at 10:16 am

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

Wijmo Team Member
Ashish Jindal posted on November 6, 2012 at 9:47 am

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

Answer
Wijmo Team Member
xanadu posted on November 7, 2012 at 8:06 am

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

Answer
Wijmo Team Member
Ashish Jindal posted on November 7, 2012 at 9:23 am

Hello Xanadu,

Here is the sample using Bar chart in Composite chart.

Regards

Answer
Wijmo Team Member
xanadu posted on November 7, 2012 at 9:46 am

Ashish Jindal, works like a charm, big thanks :-)

Answer
Wijmo Team Member
xanadu posted on November 12, 2012 at 1:30 pm

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);
                }

            });
Answer
Wijmo Team Member
xanadu posted on November 15, 2012 at 9:06 am

Any ideas? :-)

Answer
Wijmo Team Member
xanadu posted on November 19, 2012 at 8:33 am

When I’m doing:


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 :/

Answer
Wijmo Team Member
xanadu posted on November 20, 2012 at 12:07 pm

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


Answer
Wijmo Team Member
xanadu posted on November 20, 2012 at 12:08 pm

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

Answer
Wijmo Team Member
Ashish Jindal posted on November 20, 2012 at 12:10 pm

Hello Xanadu,

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

Regards

Answer

This topic has 2 voices, contains 10 replies, and was last updated by  Ashish Jindal 703 days ago.

You must be logged in to reply to this topic.