Sparkline Width Issues - Date Axis

2 posts, 0 answers
  1. Bill
    Bill avatar
    75 posts
    Member since:
    Feb 2013

    Posted 25 Feb 2014 Link to this post

    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.

        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"

  2. Iliana Nikolova
    Iliana Nikolova avatar
    2571 posts

    Posted 28 Feb 2014 Link to this post

    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.

    Iliana Nikolova
Back to Top