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

Bar Chart Label Overflow Hidden

2 Answers 285 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Kevin Kembel
Top achievements
Rank 1
Kevin Kembel asked on 13 Jan 2014, 08:45 PM
I'm experiencing a difference between IE and Chrome with the label overflow on the charts.  I'm using the sparkline to create a few barcharts in a table, and the labels are being cut off when viewing it in Chrome, overflow is visible in IE10.

Attached are some screenshots.  The bottom bar is 100%, the value = valueAxis.max.  The labels are set to "outsideEnd".  I've tried "insideEnd" which works when the value is 100%, but when the bar is 0% the "insideEnd" labels are cut off.  Not sure if I can make it conditional, display "insideEnd" if bar value is >50% and "outsideEnd" if bar value is <= 50%...

DataViz version is Q3 2013 1119.

The chart hierarchy is in:
      <table><tr><td><div><span id="sparkline"></span></div></td></tr></table>
I've tried setting overflow:visible on all of the parent elements.

2 Answers, 1 is accepted

Sort by
0
Kevin Kembel
Top achievements
Rank 1
answered on 13 Jan 2014, 09:35 PM
Played with the dataBound event to use 'outsideEnd' when less than 25%, otherwise 'insideEnd'.  This works in the meantime, although not exactly the behavior I'd like (looks a little funny when there are several bars around that mark: 23, 24, 25, 26, 27, etc).
dataBound: function (e) {
    e.sender.options.series[0].labels.position = function (point) {
        if (point.value >= 25) {
            return 'insideEnd';
        }
        return 'outsideEnd';
    }
}
0
T. Tsonev
Telerik team
answered on 15 Jan 2014, 04:37 PM
Hello,

I don't think I can offer anything better than the functional approach that you're using.

We have some research going regarding smart label position w/boundary detection.
This is not ready for the prime time yet, but I hope one day such patches won't be necessary.

Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Sparkline
Asked by
Kevin Kembel
Top achievements
Rank 1
Answers by
Kevin Kembel
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or