Sparkline full width

3 posts, 1 answers
  1. Andreas
    Andreas avatar
    15 posts
    Member since:
    Oct 2018

    Posted 03 Dec 2018 Link to this post

    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. Answer
    Stefan
    Admin
    Stefan avatar
    2913 posts

    Posted 04 Dec 2018 Link to this post

    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
  3. Andreas
    Andreas avatar
    15 posts
    Member since:
    Oct 2018

    Posted 05 Dec 2018 in reply to Stefan Link to this post

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

Back to Top