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

Chart doesn't show all series after datasource.read()

10 Answers 235 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Dirk
Top achievements
Rank 1
Dirk asked on 01 Oct 2013, 09:01 PM
Hello,

I've implemented a few charts (stacked bars, stacked areas etc) and encountered the following behaviour:

If you hide the last of three series via legend click, click the same legend item to show series again and then reaload data via datasource.read() and JSON the last series is disabled and therefore hidden (at the time new data was loaded the series was visible!).
Since I did not found a way to explicitly show the series again (after loading data) you have to click another time the legend item to see the series on the chart again.

JS to load new data:
var chart = $("#AverageCountPerDay").data("kendoChart");
        // recalculate value axis range
        chart.options.valueAxis.max = undefined;
        chart.dataSource.read({ groupNumber: "@Model.GroupID", startDate: startDate.value().toJSON(), endDate: endDate.value().toJSON(), granularity: "day" });

Is there a way to fix this problem or an appropriate workaround?

TIA
Dirk

10 Answers, 1 is accepted

Sort by
0
Hristo Germanov
Telerik team
answered on 03 Oct 2013, 07:24 AM
Hello Dirk,

I confirm that this is a bug and I am glad to inform you that it is already fixed in the latest internal build. If you want you can download it and give a try.

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dirk
Top achievements
Rank 1
answered on 05 Dec 2013, 05:25 PM
Hello Hristo,

I just upgraded Kendo UI complete to new version 2013.3.1119 an this bug is still there (no change at all).

Is there a workaround?

Thanks in advance
Dirk

0
Hristo Germanov
Telerik team
answered on 09 Dec 2013, 11:58 AM
Hi Dirk,

In this case could you give me a sample project that will reproduce the depending issue. Thus I will be able to observe the problem and give you a quick resolution(if it is possible) for your requirements.

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dirk
Top achievements
Rank 1
answered on 16 Dec 2013, 01:51 PM
Hello Hristo,

this issue is simple to reproduce. Please start with your chart demo and add a button to reload data via JavaScript:
chart.dataSource.read(...);

After that hide last series 'wind' from chart via legend item click and click legend item "wind" to show again (at this time all series is displayed!)
Now reload data via newly added button and observe that the last series is not shown.

A dataviz project that loads data via ajax/json is not simple (fast) to provide.

Regards
Dirk
0
Hristo Germanov
Telerik team
answered on 18 Dec 2013, 09:43 AM
Hi Dirk,

I am unable to reproduce the problem. The screencast is available here: http://screencast.com/t/eq1DQyM7cs. Could you please tell me what am I doing wrong?

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dirk
Top achievements
Rank 1
answered on 23 Dec 2013, 04:13 PM
Hello Hristo,

I watched your screencast and the initial bug seems to be fixed as you stated earlier.
Sorry for the inconvenience caused!

What I encountered after upgrading to Q3 version (meanwhile replaced all chart legend by self-made legend) is a similar problem caused by setting visibility of series in JavaScript (not using legend click event).
To reproduce please execute the following script in browser on the mentioned demo (as you did in screencast):

$("#chart").data("kendoChart").options.series[2].visible = false;
$("#chart").data("kendoChart").redraw();
$("#chart").data("kendoChart").options.series[2].visible = true;
$("#chart").data("kendoChart").redraw();

$("#chart").data("kendoChart").options.series[1].visible = false;
$("#chart").data("kendoChart").redraw();
$("#chart").data("kendoChart").options.series[1].visible = true;
$("#chart").data("kendoChart").redraw();

$("#chart").data("kendoChart").options.series[0].visible = false;
$("#chart").data("kendoChart").redraw();
$("#chart").data("kendoChart").options.series[0].visible = true;
$("#chart").data("kendoChart").redraw();

at this time all series should be visible


And now execute:
$("#chart").data("kendoChart").dataSource.read();
Please observe, that 'Wind' (the last series) disappears

Best regards
Dirk

0
Hristo Germanov
Telerik team
answered on 25 Dec 2013, 07:21 PM
Hi Dirk,

I need more time to investigate the issue.  Please excuse us for the inconvenience.
 
Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Hristo Germanov
Telerik team
answered on 07 Jan 2014, 04:34 PM
Hi Dirk,

In this case I suggest you to use setOptions. Live Example

Could you please tell me if there is a problem with this approach?

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dirk
Top achievements
Rank 1
answered on 07 Jan 2014, 06:56 PM
Hi Hristo,

the approach you provided  (setting chartOptions explicitly) seems to work. That's the good news.

On the other side the behaviour itself is from my point of view not correct and should be fixed in a future release.

Thanks for your support
Dirk
0
Hristo Germanov
Telerik team
answered on 08 Jan 2014, 08:28 AM
Hi Dirk,

There is no easy fix for this issue but I will log it for investigation and fix.

I have updated your points.

Regards,
Hristo Germanov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Dirk
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Dirk
Top achievements
Rank 1
Share this question
or