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

Sparkline Width Issues - Date Axis

1 Answer 90 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 25 Feb 2014, 11:36 PM
I'm setting the datasource of the sparkline to a json result which has 365 days of data.  I plan to use the sparkline to aggregate the data and plot a smaller subset of data points as 365 is not something you'd want to plot in a small area.  I set the baseUnit of the date categoryAxis to months so it will plot 12 points, which it does, but the width is out of control...  it spans way beyond the confines of my plot area.

I think the problem lies with the width algorithm of sparklines when using baseUnits/aggregate w/ a date category axis.  Even though we are only plotting 12 points, the sparkline behaves as if it is plotting 365.  Documentation states that, "The width of line, area and column sparklines is determined by the number of data points".  Help me understand this... other charts are responsive yet the sparkline is not?  The sparkline is not taking the final number of datapoints after baseUnits/aggregates are applied with the date axis.

$("#sparkQtyVehicles").kendoSparkline({
    series: [{
        name: "QtyVehicles",
        aggregate: "avg",
        type: "column",
        field: "QtyVehicles"
    }],
    categoryAxis: {
        type: "date",
        baseUnit: "months",
        field: "Date"
    },
    tooltip: {
        visible: true,
        shared: false,
        template: $('#sparkQtyVehiclesTemplate').html()
    },
    theme: "bootstrap"
});

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 28 Feb 2014, 08:35 AM
Hi Bill,

Thank you for pointed our attention to this issue - it appears there is a bug in the width calculation of SparkLine with date axis. I forwarded the issue to our developers for further investigation - we will do our best to address it as soon as possible. Please excuse us for the inconvenience caused.

As a small sign of gratitude I updated your points.

Regards,
Iliana Nikolova
Telerik
Tags
Sparkline
Asked by
Bill
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or