dimple.js 无法解决这些问题
dimple.js Cannot Fix these issues
我在 dimple js 中有一些需求,但我在任何地方都找不到与我的查询相关的任何内容。我制作了一个简单的条形图,但值按升序排列,Y 轴标签隐藏,值转换为 1k,2k。
请帮我解决这 3 个问题:
- 停止按升序对数据进行排序
- 缩短 Y 轴上的标签
显示 json 中的精确值而不是将其转换为 1k、2k
var data = [
{
"Service" : "Primary Services" ,
"Total Services" : "10065"
} ,
{
"Service" : "PCP" ,
"Total Services" : "851"
} ,
{
"Service" : "scientist" ,
"Total Services" : "8818"
} ,
{
"Service" : "NP/PA/CNS" ,
"Total Services" : "5854"
} ,
{
"Service" : "FQHC/RHC" ,
"Total Services" : "8574"
}
];
var svg = dimple.newSvg("#types-of-services", 500, 300);
var myChart = new dimple.chart(svg, data);
// Set bounds
myChart.setBounds(0, 0, "5%", "5%")
myChart.setMargins("75px", "0px", "20px", "50px");
var x = myChart.addMeasureAxis("x", "Total Services");
var y = myChart.addCategoryAxis("y", "Service");
myChart.addSeries(null, dimple.plot.bar);
x.fontSize = "12";
y.fontSize = "12";
x.fontFamily = "Roboto";
y.fontFamily = "Roboto";
myChart.draw(1700);
x.titleShape.remove();
$(window).on('resize', resize);
$('.sidebar-control').on('click', resize);
function resize() {
myChart.draw(0, true);
x.titleShape.remove();
}
测量轴将排序,显示为 1K、2K 等,改用分类轴...
// var x = myChart.addMeasureAxis("x", "Total Services");
var x = myChart.addCategoryAxis("x", "Total Services");
我在 dimple js 中有一些需求,但我在任何地方都找不到与我的查询相关的任何内容。我制作了一个简单的条形图,但值按升序排列,Y 轴标签隐藏,值转换为 1k,2k。
请帮我解决这 3 个问题:
- 停止按升序对数据进行排序
- 缩短 Y 轴上的标签
显示 json 中的精确值而不是将其转换为 1k、2k
var data = [ { "Service" : "Primary Services" , "Total Services" : "10065" } , { "Service" : "PCP" , "Total Services" : "851" } , { "Service" : "scientist" , "Total Services" : "8818" } , { "Service" : "NP/PA/CNS" , "Total Services" : "5854" } , { "Service" : "FQHC/RHC" , "Total Services" : "8574" } ]; var svg = dimple.newSvg("#types-of-services", 500, 300); var myChart = new dimple.chart(svg, data); // Set bounds myChart.setBounds(0, 0, "5%", "5%") myChart.setMargins("75px", "0px", "20px", "50px"); var x = myChart.addMeasureAxis("x", "Total Services"); var y = myChart.addCategoryAxis("y", "Service"); myChart.addSeries(null, dimple.plot.bar); x.fontSize = "12"; y.fontSize = "12"; x.fontFamily = "Roboto"; y.fontFamily = "Roboto"; myChart.draw(1700); x.titleShape.remove(); $(window).on('resize', resize); $('.sidebar-control').on('click', resize); function resize() { myChart.draw(0, true); x.titleShape.remove(); }
测量轴将排序,显示为 1K、2K 等,改用分类轴...
// var x = myChart.addMeasureAxis("x", "Total Services");
var x = myChart.addCategoryAxis("x", "Total Services");