amCharts宽度字段和解析日期

时间:2016-11-03 21:04:22

标签: javascript format amcharts

我在amCharts中有一个序列图。我需要将解析日期设置为false,但这会将所有数据推向图的左侧(将右半部分留空)。如果我将“宽度”字段设置为“类别”(x轴),修复推送的数据,则数据外观颜色会变得太宽。我尝试更改一些格式,但这些更改似乎没有任何影响

{
"type": "serial",
"categoryField": "Category",
"dataDateFormat": "",
"autoMarginOffset": 40,
"marginRight": 60,
"marginTop": 60,
"backgroundAlpha": 0.54,
"backgroundColor": "#FFF8F8",
"color": "#5C2C2C",
"fontFamily": "",
"fontSize": 13,
"handDrawThickness": 0,
"theme": "black",
"categoryAxis": {
    "autoRotateAngle": 0,
    "dateFormats": [
        {
            "period": "fff",
            "format": "JJ:NN:SS"
        },
        {
            "period": "ss",
            "format": "JJ:NN:SS"
        },
        {
            "period": "mm",
            "format": "JJ:NN"
        },
        {
            "period": "hh",
            "format": "JJ:NN"
        },
        {
            "period": "DD",
            "format": "MMM DD"
        },
        {
            "period": "WW",
            "format": "MMM DD"
        },
        {
            "period": "MM",
            "format": "MMM"
        },
        {
            "period": "YYYY",
            "format": "YY"
        }
    ],
    "minPeriod": "YYYY",
    "widthField": "Category",
    "dashLength": 6,
    "title": "Local Position, Time in 'United State of Pop 2008'",
    "titleRotation": 0
},
"chartCursor": {
    "enabled": true,
    "animationDuration": 0,
    "balloonPointerOrientation": " vertical",
    "categoryBalloonDateFormat": "YY"
},
"chartScrollbar": {
    "enabled": true
},
"trendLines": [],
"graphs": [
    {
        "balloonText": "<b>[[Melodytext]] </b>([[category]],  [[value]])",
        "bullet": "square",
        "bulletBorderAlpha": 1,
        "bulletColor": "#2EC0B1",
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 1,
        "fillColors": "#36D9C8",
        "id": "Melody",
        "lineAlpha": 0.44,
        "title": "Melody",
        "type": "column",
        "valueField": "Melodydata"
    },
    {
        "balloonText": "<b>[[Melodytext2]] </b>([[category]],  [[value]])",
        "bullet": "square",
        "bulletBorderAlpha": 1,
        "bulletColor": "#2EC0B1",
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 1,
        "fillColors": "#36D9C8",
        "id": "Melody2",
        "lineAlpha": 0.44,
        "title": "Melody2",
        "type": "column",
        "valueField": "Melodydata2"
    },
    {
        "balloonText": "<b>[[Melodytext3]] </b>([[category]],  [[value]])",
        "bullet": "square",
        "bulletBorderAlpha": 1,
        "bulletColor": "#2EC0B1",
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 1,
        "fillColors": "#36D9C8",
        "id": "Melody3",
        "lineAlpha": 0.44,
        "title": "Melody3",
        "type": "column",
        "valueField": "Melodydata3"
    },
    {
        "balloonText": "<b>[[Instrumentaltext]] </b>([[category]],  [[value]])",
        "bullet": "triangleUp",
        "bulletAlpha": 0,
        "bulletBorderAlpha": 1,
        "bulletColor": "#F21D1D",
        "bulletHitAreaSize": -5,
        "bulletSize": 5,
        "fixedColumnWidth": -5,
        "id": "Instrumental",
        "lineColor": "#E56565",
        "title": "Instrumental",
        "valueField": "Instrumentaldata"
    },
    {
        "balloonText": "<b>[[Instrumentaltext2]] </b>([[category]],  [[value]])",
        "bullet": "triangleUp",
        "bulletBorderAlpha": 1,
        "bulletBorderThickness": 1,
        "bulletColor": "#F21D1D",
        "bulletSize": 5,
        "id": "Instrumental2",
        "lineColor": "#E56565",
        "title": "Instrumental2",
        "valueField": "Instrumentaldata2"
    },
    {
        "balloonText": "<b>[[aMelodytext]] [[aMelodytext2]] [[aMelodytext3]] [[aMelodytext4]]</b> ([[category]],  [[value]])",
        "bullet": "square",
        "bulletColor": "#5C574A",
        "bulletHitAreaSize": 1,
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 0.12,
        "fillColors": "#5C574A",
        "fixedColumnWidth": -25,
        "id": "aMelody",
        "lineColor": "#5C574A",
        "lineThickness": 2,
        "negativeLineColor": "#FFF8F8",
        "title": "aMelody",
        "useNegativeColorIfDown": true,
        "valueField": "aMelodydata"
    },
    {
        "bullet": "square",
        "bulletBorderAlpha": 1,
        "bulletColor": "#5C574A",
        "bulletHitAreaSize": 1,
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 0.12,
        "fillColors": "#5C574A",
        "fixedColumnWidth": -2,
        "fontSize": -1,
        "id": "aMelody2",
        "lineColor": "#5C2C2C",
        "lineThickness": 2,
        "negativeLineColor": "#FFF8F8",
        "showBalloon": false,
        "title": "aMelody2",
        "useNegativeColorIfDown": true,
        "valueField": "aMelodydata2"
    },
    {
        "bullet": "square",
        "bulletBorderAlpha": 1,
        "bulletColor": "#5C574A",
        "bulletHitAreaSize": 1,
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 0.12,
        "fillColors": "#5C574A",
        "fixedColumnWidth": -1,
        "fontSize": -1,
        "id": "aMelody3",
        "lineColor": "#5C2C2C",
        "lineThickness": 2,
        "negativeLineColor": "#FFF8F8",
        "showBalloon": false,
        "title": "aMelody3",
        "useNegativeColorIfDown": true,
        "valueField": "aMelodydata3"
    },
    {
        "bullet": "square",
        "bulletBorderAlpha": 1,
        "bulletColor": "#5C574A",
        "bulletHitAreaSize": 1,
        "bulletSize": 5,
        "columnWidth": 0.44,
        "cornerRadiusTop": 8,
        "fillAlphas": 0.12,
        "fillColors": "#5C574A",
        "fixedColumnWidth": -1,
        "fontSize": -1,
        "id": "aMelody4",
        "lineColor": "#5C574A",
        "lineThickness": 2,
        "negativeLineColor": "#FFF8F8",
        "showBalloon": false,
        "title": "aMelody4",
        "useNegativeColorIfDown": true,
        "valueField": "aMelodydata4"
    }
],
"guides": [],
"valueAxes": [
    {
        "id": "ValueAxis-1",
        "minimum": 1,
        "title": "Global Position, Time bysourced samples"
    }
],
"allLabels": [],
"balloon": {},
"titles": [],
"dataProvider": [
    {
        "Category": "1",
        "Melodydata": "",
        "Melodytext": "",
        "Melodydata2": "",
        "Melodytext2": "",
        "Melodydata3": "",
        "Melodytext3": "",
        "Instrumentaldata": "1",
        "Instrumentaltext": "text",
        "Instrumentaldata2": "",
        "Instrumentaltext2": "",
        "aMelodydata": "",
        "aMelodytext": "",
        "aMelodydata2": "",
        "aMelodytext2": "",
        "aMelodydata3": "",
        "aMelodytext3": "",
        "aMelodydata4": "",
        "aMelodytext4": ""
    },

0 个答案:

没有答案