This is a migrated thread and some comments may be shown as answers.

bar/column/line chart displays value on a wrong place

5 Answers 148 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Andras
Top achievements
Rank 1
Andras asked on 08 Nov 2012, 01:00 PM
Hello,

Based on your sample (http://jsbin.com/oxuvom/3/edit) I tried what happens if I have 2 rows of data and one of them has a missing value. In this case the values next to the missing one are shifted to a wrong place: http://jsbin.com/oxuvom/29/edit

Please let me know if I missed something.

Thanks,
Andras


5 Answers, 1 is accepted

Sort by
0
Accepted
Iliana Nikolova
Telerik team
answered on 13 Nov 2012, 11:38 AM
Hi Andras,

The observed behavior is expected and is due to the following: 
  • By design the labels for the categoryAxis in grouped chart are created depending on the first group;
  • The categorical charts (such as Bar, Column, Area, Line) demand a matching set of data points. Please note that the value can be null, but the record needs to be presented at the data (this is due to the fact that series.data is a simple array). 

Hence in order to get all the values on the right places you should include in the data a value for the Jan 2012. For your convenience I updated the page.
  
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andras
Top achievements
Rank 1
answered on 13 Nov 2012, 12:10 PM
Ok, thanks!
0
Andras
Top achievements
Rank 1
answered on 13 Nov 2012, 01:58 PM
Please have a look at this sample: http://jsbin.com/oxuvom/39/edit or the attached one. 
This looks good in IE(9), Safari(5.1.7), Firefox(16.0.2), but not in Chrome (23.0.1271.64 m)
The value (Percentage) of 10/3 is shown at 10/5 in Chrome. Everywhere else it looks good. The same issue when using bar or column instead of line. The strange thing is that it happens if I have at least 4 line/bar/column. With 3 it's ok in Chrome too.

Thanks,
Andras
0
Accepted
Iliana Nikolova
Telerik team
answered on 16 Nov 2012, 12:02 PM
Hello Andras,

In order to get the expected order you could sort the dataSource and configure the needed direction: 

$("#chart").kendoChart({
  //....
  dataSource: {
      data: costHistory,
      group: {
         field: "Name",
         dir: "asc"
      },
      sort: {
         field: "Percentage",
         dir: "desc"
      }
  }
//....
});

For your convenience I updated the jsBin example.

On a side note, I recommend using the latest version of Kendo UI as it contains many bug fixes and improvements.

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andras
Top achievements
Rank 1
answered on 16 Nov 2012, 12:16 PM
Thank You!

Sort solved my problem.
Tags
Charts
Asked by
Andras
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Andras
Top achievements
Rank 1
Share this question
or