I have a Kendo Chart in Angular:
<div class="sensor-graph"><!--Strength-->
<div class="value-name">Strength ({{sensor.lastKnownStrength}})</div>
<kendo-chart
[transitions]="false"
[chartArea]="{background: 'var(--table-header)'}"
[legend]="{visible: false}"
[seriesColors]="seriesColors"
[tooltip]="{visible: true}"
[axisDefaults]="{majorGridLines: { dashType:'dot', visible: true}}">
<kendo-chart-value-axis>
<kendo-chart-value-axis-item
type="numeric">
</kendo-chart-value-axis-item>
</kendo-chart-value-axis>
<kendo-chart-category-axis>
<kendo-chart-category-axis-item
[categories]="sensor.strengthCategories"
[visible]="false">
</kendo-chart-category-axis-item>
</kendo-chart-category-axis>
<kendo-chart-series>
<kendo-chart-series-item
[markers]="{ visible: false }"
[color]="seriesColors[1]"
name="Strength"
type="area"
field="value"
[line]="{ width: 1 }"
[tooltip]="{ visible: true, format: '{0}' }"
[missingValues]="'interpolate'"
[data]="sensor.strengthHistory">
</kendo-chart-series-item>
</kendo-chart-series>
<kendo-chart-tooltip>
<ng-template kendoChartSeriesTooltipTemplate let-category="category" let-value="value">
{{ category }} | {{ value }}
</ng-template>
</kendo-chart-tooltip>
</kendo-chart>
{{ sensor.strengthCategories[0] }} / {{ sensor.strengthCategories[sensor.strengthCategories.length - 1] }}
</div>
<br>
categories are type – ‘number’:
sensorData.strengthCategories.push((item.sensor_ts_utc) as number)
chart:
enter image description here
THE PROBLEM:
The X axis is not showing intervals, the distances are not proportional as it should be. For example: the distance between 100 and 10000 can be the same as between 100 and 101.
I was trying to add [majorUnit] or [minorUnit] but the intervals are the same.
ChatGPT is not very helpful, the documentation is not clear about it: https://www.telerik.com/kendo-angular-ui/components/charts/api/XAxis/
Btw. I do know how to make Categories as time and I succeeded with configuring time intervals. But I need to have X axis as numeric in this case.
Diana Granat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.