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

Line chart minor ticks between major ticks don't line up at major ticks when category axis is justified

1 Answer 358 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 03 Oct 2013, 11:56 PM
I'm attempting to display major ticks every X base units and minor ticks at every base unit along the category axis of a line chart (category labels are setup to display at the major tick position too).

The problem I'm experiencing is that as the minor ticks are rendered across the category axis, they aren't lining up correctly with the major tick (a few pixels off depending on the chart width - larger chart width makes the alignment problem more noticeable).  This is only occurring when the categoryAxis.justified is set to true.  If it is set to false, the minor ticks line up perfectly between the major ticks.

I've set up a simple example here demonstrating the problem: jsFiddle

If that doesn't work, here is the snippet:
<div id="chart"></div>
<script>
$("#chart").kendoChart({
  seriesDefaults: {
    width: 1
  },
  series: [ {
    type: "line",
    line: {
      width: 1
    },
    markers: {
      visible: true,
      size: 3
    },
    data: [1, 2, 3, 2, 4, 6, 2, 5, 1, 4, 1, 3, 4, 4, 2, 5, 6, 4, 3, 4, 2, 2, 4, 5, 6, 2, 3, 0, 1]
  }],
  categoryAxis: {
    justified: true,
    majorGridLines: {
      visible: true,
      step: 8
    },
    minorGridLines: {
      visible: true,
      step: 2
    },
    majorTicks: {
      step: 8,
      color: "#ff0000",
      size: 10,
      width: 2
    },
    minorTicks: {
      visible: true,
      step: 2,
      color: "#ff00ff",
      size: 5
    }
  }
});
</script>
The major and minor grid lines are also setup to have the same step values as the ticks and display the same behavior of minor grid lines not falling perfectly between major grid lines.

The minor ticks/grid lines seem to get more and more out of line with the major ticks/grid lines the further along the category axis they go.

The version of kendo I've been using in development is v2013.2.925 (the jFiddle version is v2013.2.918).

On another note, why do I need to specify a step value of double what I would like the base units to step for minor ticks/grid lines?  In the example I've posted you will notice that the minor ticks/grid lines are set to step every 2 base units, but they actually step every base unit when the chart is rendered.

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 04 Oct 2013, 01:03 PM
Hi Albert,

Thank you for pointed our attention to this issue - it appears there is a bug in the current version of Kendo UI and forwarded it to the developers for further investigation. Please excuse us for the inconvenience caused.

As a small sign of gratitude for this finding I updated your points. 

Regards,
Iliana Nikolova
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
Albert
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or