Search code examples
anychart

map pointWidth to a single Datapoint in Column Chart


I know i can set the pointWidth ("Bar-width") to a whole series in Anychart.

series1.pointWidth(20);

Here:Anychart Documentation

But how can I map a width to just a single Bar in the series?

Example Chart

I also know I can map other attributes like color already, but no pointWidth:

// create a data set
    var data = anychart.data.set([
      ["John", 10000, 12500],
      ["Jake", 12000, 15000],
      ["Peter", 13000, 16500, "#5cd65c", "#009933", null, {enabled: true}],
      ["James", 10000, 13000],
      ["Mary", 9000, 11000]
    ]);

    // map the data
    var seriesData_1 = data.mapAs({x: 0, value: 1, fill: 3, stroke: 5, label: 6});

Solution

  • If you want to set point width according to its value, probably BarMekko chart will meet your requirements. But if you want to set point width exactly only for a single one bar in Column chart, please let me know in your next comment.