Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

Anychart bar chart x-labels not fixing chart area?

I'm facing a problem. The x labels in a bar chart get out of the chart area. I'm using wordWrap and wordBreak only in some resolutions, they in others fix good. I'm using this anychart8.2.1 code

    var chart = anychart.bar();
    var serieData1 = data.mapAs({x: 0, value: 2,);
    // create a bar series and set the data
    var series = chart.bar(serieData1);
    series.name("%Cumplimiento");
    series.labels(true);
    chart.legend(true);
    chart.xAxis().labels().fontSize(10);
            
    var xLabels = chart.xAxis().labels();
    xLabels.width(375);
    xLabels.hAlign('end');
    xLabels.wordWrap("break-word");
    xLabels.wordBreak("break-all");
    chart.yScale().minimum(0);
    chart.yScale().maximum(120);
    chart.yScale().ticks().interval(20);
    chart.bounds("10%", ”0%”, "80%", "43%");
    chart.container(container);

The container is a stage, the labels must be right align and i supose the chart area is the gray area isn't it?

Wrong labels example https://imagizer.imageshack.com/img924/9987/HPFp1c.png

Fix labels example https://imagizer.imageshack.com/img923/5839/eJ9obs.png

How can i fix it? Thanks


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...