phibr0 / obsidian-charts

Charts - Obsidian Plugin | Create editable, interactive and animated Charts in Obsidian via Chart.js
https://charts.phib.ro/
GNU Affero General Public License v3.0
546 stars 25 forks source link

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

Open EmrecanKaracayir opened 1 year ago

EmrecanKaracayir commented 1 year ago

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
\`\`\``)
SonamorN commented 1 year ago

Have you found a solution for this?

EmrecanKaracayir commented 1 year ago

No, I couldn't.

kimobot commented 3 months ago

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);