This is a migrated thread and some comments may be shown as answers.

Sparkline full width

2 Answers 134 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 03 Dec 2018, 01:53 PM

I've been trying for hours to set the width of the <Sparkline data={[55, 52, 61, 66, 74, 68, 77, 83]} /> to 100% or a number set in pixles, but I just can't get it to work!

I've tried setting it with css, with inline style, with a wrapping div and inline style and/or css and nothing is working. The only thing that can make the sparkline fill out more width seems to feed it more data (a longer array), and that isn't really an option.

 

Please help!

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 04 Dec 2018, 10:42 AM
Hello, Andreas,

Currently, the desired result can be achieved using CSS rule to set the width:

.k-sparkline {
  width: 300px !important;
}

https://stackblitz.com/edit/react-a4jv1s?file=index.html

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andreas
Top achievements
Rank 1
answered on 05 Dec 2018, 10:11 AM

Thank you Stefan!

This was the only option I hadn't tried, to put the css rule in an css file and import it in my component. It works :)

Tags
Wrappers for React
Asked by
Andreas
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or