我不想显示与阻止比较,我试图使其可以伪造,但这不起作用。
"stockGraphs": [ {
"id": "g1",
"valueField": "value",
"comparable": false,
"compareField": "value",
"balloonText": "[[title]]:<b>[[value]]</b>",
"compareGraphBalloonText": "[[title]]:<b>[[value]]</b>"
} ],
答案 0 :(得分:1)
您可以在其他数据集中将compared
设置为true(忽略第一个,因为默认情况下始终显示),以便在不使用选择器的情况下显示数据集:
"dataSets": [ {
"title": "first data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData1,
//don't set compared in the first dataset or it will be displayed twice
"categoryField": "date"
}, {
"title": "second data set",
"fieldMappings": [ {
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
} ],
"dataProvider": chartData2,
"compared": true,
"categoryField": "date"
},
// ... etc
如果要显示其他数据集而不更改百分比,请在所需面板中将recalculateToPercents
设置为"never"
,或在panelsSettings
中全局设置。
修改的
如果您想隐藏“比较到”:部分,请添加以下CSS:
.amcharts-compare-div {
display: none;
}
/* hide the br tags before and after the dropdown, brining the compare to box up */
.amcharts-data-set-selector-div br:first-child, .amcharts-data-set-selector-div br+select+br, .amcharts-data-set-selector-div br+select+br+br {
display: none;
}
您还需要将dataSetSelector的compareText
属性设置为空字符串。