1
votes

Is there a way to assign different markers types (circle, square, triangle, etc) to specific data points on the same series? (I am using scatterLine chart)

I know it can be done with the color: Assigning specific color to each data point example

And also you can change the type for the whole series: example

But I need to have on the same line at least 2 different types (circles and triangles)

Any suggestion is welcome, thanks

1

1 Answers

0
votes

You could use the visual property of the series markers to draw the shape you want e.g.:

series: [{
  type: "line",
  markers: {
    visual: function (e) {
      var origin = e.rect.origin;
      var center = e.rect.center();
      var bottomRight = e.rect.bottomRight();

      if (e.value < 2){
        return e.createVisual();
      } else {
        var path = new kendo.drawing.Path({
          stroke: {color: e.options.border.color, width: 2},
          fill: { color: "white" }
        })
        .moveTo(origin.x, bottomRight.y)
        .lineTo(bottomRight.x, bottomRight.y)
        .lineTo(center.x, origin.y)
        .close();

        return path;
      }
    }
}

DEMO