简体   繁体   中英

yui charts - using connectPoints

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?

set the weight of the line to 0

 styles: {
            line: {
                weight: 0
            }
        }

Working example: http://jsfiddle.net/ffPG7/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM