0

I am new to yui and trying to create a chart which displays only points (no connection between the points). I am using chart of type line and removing the connection between the points by setting "connectPoints" attribute to false (as mentioned in the API). But the points are still connected. My code is as follows:

var data = '[{"lowRange":1.1 "dateTime":1329264000000},
                {"lowRange":1.1, "dateTime":1331769600000}]';

    var myAxes = {
        resultsData:{
            keys:["lowRange"],
            position:"left",
            type:"numeric",
            styles:{
                majorTicks:{
                    display: "none"
                }
            }
        },
        dateRange:{
            keys:["dateTime"],
            position:"bottom",
            type:"time",
            styles:{
                majorTicks:{
                    display: "none"
                },
                label: {
                    rotation:-45,
                    margin:{top:5}
                }
            }
        }
    };

   var seriesCollection = [{
        type:"line",
        xAxis:"dateRange",
        yAxis:"resultsData",
        xKey:"dateTime",            
        yKey:"lowRange",
        xDisplayName:"Date",
        yDisplayName:"Low Range",
        style: {                
            connectPoints:false             
        }
    }]  

var myChart = new Y.Chart({   
                    dataProvider:data, 
                    axes:myAxes, 
                    seriesCollection:seriesCollection,             
                    render:"#container"                       
                });

Can anyone please provide example of creating a graph like this or explain how to use connectPoints attribute?

4

1 回答 1

0

将线的权重设置为 0

 styles: {
            line: {
                weight: 0
            }
        }

工作示例:http: //jsfiddle.net/ffPG7/

于 2014-04-03T10:42:32.603 回答