Bar Sparkline that fills div 100%

5 posts, 1 answers
  1. Josh
    Josh avatar
    72 posts
    Member since:
    Jun 2013

    Posted 21 May 2014 Link to this post

    I'm trying to find the right settings to get a Bar Sparkline to fill a div with just the bar image and no padding, white space or anything else around it. I've set the following, which gets close, but clips some of the image. Is there a way to do this?

    <div id="files-format-chart" style="width:1120px;line-height:30px;cursor: pointer;"></div>

    $("#files-format-chart").kendoSparkline({
        type: "bar",
        chartArea: {
            opacity: 0,
            margin: 0
        },
        plotArea: {
            opacity: 0,
            margin: 0
        },
        series: /*array of series*/,
        valueAxis: {
            max: /*max value of series data to avoid space*/
        }
    });




  2. Josh
    Josh avatar
    72 posts
    Member since:
    Jun 2013

    Posted 22 May 2014 in reply to Josh Link to this post

    Nevermind. I was setting the max for value axis incorrectly. It works now. :)
  3. Kendo UI is VS 2017 Ready
  4. Josh
    Josh avatar
    72 posts
    Member since:
    Jun 2013

    Posted 27 May 2014 in reply to Josh Link to this post

    Sorry, I take it back. I'm not able to find a way to get rid of all the whitespace around the bar of a sparkline. See the red circled space in the attached screenshot - this is the space I'm trying to get rid of.

    Here's the example
  5. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 28 May 2014 Link to this post

    Hi Josh,

    In order to achieve the expected result you should set gap / spacing options to 0
    $(".bar-benefits", row).kendoSparkline({
      //....
      series: [{
         //....
         gap: 0,
         spacing: 0
      }],
    });

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Josh
    Josh avatar
    72 posts
    Member since:
    Jun 2013

    Posted 28 May 2014 in reply to Iliana Nikolova Link to this post

    You're my hero. :)
Back to Top
Kendo UI is VS 2017 Ready