2

I'm trying to integrate Kendo Charts into my project, but unlike other Kendo components, Charts are not displayed as expected. What I expect:Component on Kendo site
What I get:Component on my site
Code:
<Chart>
<ChartSeries>
<ChartSeriesItem data={[ 1, 2, 3, 5 ]} name="Fibonacci"/>
</ChartSeries>
</Chart>

Vlad
  • 21
  • 3

1 Answers1

0

Seeing at the documentation. You're probably missing the styling theme.

Try installing the default theme: npm install --save @progress/kendo-theme-default

and then import it in your App.jsx or App.tsx file, or in the component you have your chart.

import '@progress/kendo-theme-default/dist/all.css';

Or according to kendo examples, you could simply add the styling in the index.html head:

<link rel="stylesheet" href="https://kendo.cdn.telerik.com/themes/4.42.0/default/default-main.css"></link>

I prefer the first option.

SakisTsalk
  • 796
  • 7
  • 18
  • Thanks, but as I said, other components work well for me, I have a kendo theme, but it doesn't help. – Vlad Jan 12 '22 at 09:04
  • Well sorry about that, I'm pretty sure it's the theme not being imported correctly in that specific component. Do you import it there? – SakisTsalk Jan 12 '22 at 09:17
  • I can use any kendo components on the same page, they look good, I can put a regular theme or even make my own, this does not affect the charts in any way. And yes I import theme in the App.tsx – Vlad Jan 12 '22 at 09:26
  • Well if nothing works, then I suggest you create a reproducible sandbox example. It is unclear what the cause is by what you've shared. – SakisTsalk Jan 12 '22 at 09:29
  • I tried it in the sandbox and it works, but it doesn't work in my project. I tried reinstalling but nothing helps. I don't know what to do – Vlad Jan 12 '22 at 09:44
  • as if the component just doesn't know that I'm importing a theme – Vlad Jan 12 '22 at 09:48
  • Try importing the theme in the component again, there might be a styling interference from other components in your setup. Sorry again shooting in blind without any repro – SakisTsalk Jan 12 '22 at 10:02
  • I am having similar issues. I did notice when I went to the sandbox they include a cdn stylesheet that is not kendo-default-themes. – NewfrontSolutions Feb 14 '22 at 16:28