obsidian-charts icon indicating copy to clipboard operation
obsidian-charts copied to clipboard

Is there a way in radar chart to change increment intervals?

Open EmrecanKaracayir opened this issue 2 years ago • 3 comments

Is there a way to make this radar chart show increments as 0 to 5 integers ( 0, 1, 2, 3, 4, 5)?

Ekran görüntüsü 2023-02-17 190615

code for this chart:

```dataviewjs
const src = dv.current()

dv.paragraph(`\`\`\`chart
type: radar
labels: [${src.ratingLabels}]
series:
    - title: src.title
      data: [${src.ratings}]
legend: false
fill: true
beginAtZero: true
rMax: 5
\`\`\``)
```

EmrecanKaracayir avatar Feb 17 '23 16:02 EmrecanKaracayir

Have you found a solution for this?

SonamorN avatar May 19 '23 15:05 SonamorN

No, I couldn't.

EmrecanKaracayir avatar May 20 '23 00:05 EmrecanKaracayir

It's possible to change this, but in my experience only when using window.renderChart(...). See the ChartJS' linear axis page for more options.

```dataviewjs

const chartData = {
  type: 'radar',
  data: { ... },
  options: {
    scales: {
      r: {
        ticks: {
          stepSize: 1
        }
      }
    }
  }
}

window.renderChart(chartData, this.container);

kimobot avatar Apr 04 '24 17:04 kimobot