Line break in pointLabels

22 views
Skip to first unread message

Evgeny Tartarenov

unread,
Oct 25, 2018, 6:34:15 AM10/25/18
to jqplot-users
I want to be able to break the line in pointLabels in the right place for me. Data for the chart are presented in a such array:
var data_for_chart = [[100, 1, 'some text, some text'], [[100, 2, 'some text, some text']];
Value by index 2 is the text for the pointLabels.
If I try to use the <br/>, it is displayed on the plot in the same form.

The code for drawing the graph below

window.charts.chart1 = $.jqplot('chart1', [
    data_for_chart], {
    seriesDefaults: {
        renderer:$.jqplot.BarRenderer,
        pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
        shadowAngle: 135,
        rendererOptions: {
            barDirection: 'horizontal',
            barWidth: 33,
            barMargin: 10,
            barPadding: 10
        }
    },
    axes: {
        xaxis: {
            min: 0,
            max: 130,
            numberTicks: 14
        },
        yaxis: {
            renderer: $.jqplot.CategoryAxisRenderer,
            tickRenderer: $.jqplot.CanvasAxisTickRenderer,
            tickOptions: {
                labelPosition: 'middle',
                angle: -90
            }
        }
    }
});
Reply all
Reply to author
Forward
0 new messages