gpt4 book ai didi

javascript - Flot 刻度转子显示刻度两次

转载 作者:行者123 更新时间:2023-11-28 20:09:33 25 4
gpt4 key购买 nike

所以我用了 flot-tickrotor用于旋转图表 x 轴上的刻度的插件,现在的问题是,它显示了两次;

enter image description here

你们知道为什么会发生这种情况吗?

这是我为此使用的代码,您会注意到我没有专门添加刻度线;

        //sample data
var mainDataSet = {name:'1 - WOMENS OUTERWEAR', Actual: 181.8, Budget:15.7, BudgetVar: 8.4 } ,
{name:'2 - WOMENS LINGERIE', Actual: 12.5, Budget:6.0, BudgetVar: -1.3 } ,
{name:'3 - KIDSWEAR', Actual: 8.7, Budget:13.2, BudgetVar:0.8 } ,
{name:'5 - MENSWEAR', Actual: 4.9, Budget:4.4, BudgetVar: 0.5 } ,
{name:'6 - WOMEN FOOTWEAR+ACCES', Actual: 354.0, Budget:16.5, BudgetVar: 14.7 }
];

var graph_options = {
series: {
lines: { show:false , fillColor:'#CDD0D1', fill:true},
points: { show: false },
color: '#3B80F7',
},

grid: {
hoverable: true,
clickable: true,
show:true,
borderWidth: 0.5,
backgroundColor: { colors: ["#FFF", "#CDD0D1"] }
},
xaxis: {
mode: "categories",
//tickLength: 1,
rotateTicks: 45
}
};

var barGraphData = []; //graph_settings
var graph_settings = {label: dataSets[c].label,
data: mainDataSet,
bars: { show: true , align: "center", barWidth: 0.5},
color: '#3B80F7'
};

barGraphData.push(graph_settings);

var barGraph = $.plot($("#bar_graph_canvas"), barGraphData, graph_options);

最佳答案

好的,所以根据the issue log for flot charts这是自 0.8.1 以来 flot 的一个已知问题,解决方法是将其添加到您的样式中,直到问题得到解决;

div.xAxis div.tickLabel { display:none }

注意:请确保将其放入 HEAD 标签内的样式标签中或在添加流程图插件之前,以便可以覆盖默认样式

关于javascript - Flot 刻度转子显示刻度两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20141952/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com