如何解决Fusioncharts 带线的区域范围图
我已经成功地添加了低值和高值,但是,我仍然在为代表中间值的线而苦苦挣扎。到目前为止,这是我的代码:
const schema = [
{
"name": "Date","type": "date","format": "%Y-%m-%d",},{
"name": "Low","type": "number",{
"name": "High",];
type dataProperties = {Date: string,Low: number,High: number};
type lineProperties = {value: number};
let graphData: dataProperties[] = [];
let lineData: lineProperties[] = [];
let jsonData: dataProperties;
// Create an array of JSON objects from the data
for (let i = 1; i < data.EVI.length; i++) {
jsonData = {
Date: data.x[i],Low: data.EVI[i][2],High: data.EVI[i][0],};
graphData.push(jsonData);
lineData.push({value: data.EVI[i][1]});
}
this.variationOverTime = {
chart: {},dataset: [
{
"seriesName": "Mid","renderAs": "line","data": lineData // I'm guessing this is where I'm doing something wrong
}
],caption: {
text: "Vigour Block and Variation Over Time"
},yaxis: [
{
"plot": {
"value": {
high: "High",low: "Low"
},"type": "area-range","name": "area-range"
}
}
],};
const fusionDataStore = new FusionCharts.DataStore();
const fusionTable = fusionDataStore.createDataTable(graphData,schema);
this.variationOverTime.data = fusionTable;
我查看了 JSfiddle (https://jsfiddle.net/73xgmacm/249/) 上的另一个示例,试图将其合并到区域范围图中。目前这条线没有显示。我也没有看到任何可能有助于解决问题的错误。任何帮助将不胜感激!
解决方法
您需要在架构中创建另一个对象来表示两个范围的线(均值),请查看此演示:https://jsfiddle.net/zj9f5aed/2/
$(document).ready(function(){
var pricevat = <?php echo $vat; ?>;
$('#variator').on( 'change',function(e){
var productQty = parseFloat($(".to_overlock").val());
var meter = parseFloat($(".qty").val());
overlock = (((meter + productQty) *2) * pricevat).toFixed(2);
$('#price_overlock').val(overlock);
var meters = parseFloat($(".to_overlock").val());
var qty = parseFloat($(".qty").val());
square = ((meters * qty)).toFixed(2);
$('#square').val(square);
});})
function my_val() {
var singleValues = $('#pa_shirina-rulona').val();
var stringNum = parseInt( singleValues );
$('#to_overlock').val(stringNum);
}
$('select').change(my_val);
my_val();
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。