Вопрос

Am using flot js to get chart.Its coming fine but I am getting half of chart.What is the issue here,

My code is

 <div style="width:1120px; height:500px;"> 
<div id="chart_2" style="width:1100px; height:480px;" > </div>
</div>

DataSet1 = [ 
                 [new Date("2013/01/02").getTime(), 60],
                [new Date("2013/02/03").getTime(), 16 ],
                [new Date("2013/03/04").getTime(), 32 ],
                [new Date("2013/04/05").getTime(), 189],
                [new Date("2013/05/06").getTime(),  192],
                [new Date("2013/06/06").getTime(),  154],
                [new Date("2013/07/06").getTime(),  336],
                [new Date("2013/08/06").getTime(),  203],
                [new Date("2013/09/06").getTime(),  366],

        ];
chartColor = $(this).parent().parent().css("color");


 $.plot($("#chart_2"),[ { data: DataSet1} ] ,{
                xaxis: 
                    { mode: "time", 
                    min: (new Date("2013/01/01")).getTime(),
                    max: (new Date("2014/11/09")).getTime(),
                    timeformat: "%d/%m/%y",
                    ticks: [new Date("2013/01/01").getTime(),new Date("2013/02/01").getTime(),new Date("2013/03/01").getTime(),new Date("2013/04/01").getTime(),new Date("2013/05/01").getTime(),new Date("2013/06/01").getTime(),new Date("2013/07/01").getTime() ],
                    minTickSize :30
                    }
                ,yaxis: {
                      min:0, max: 400,  tickSize: 50 
                    },
                     series: {
                       label: "Revenue",
                       lines: { 
                            show: true,
                            lineWidth: 3, 
                            fill: true
                       },
                       shadowSize: 0
                   },
                   grid: { hoverable: true, 
                           clickable: true, 
                           tickColor: "rgba(255,255,255,.15)",
                           borderColor: "rgba(255,255,255,0)"
                         },
                   colors: ["#294777"],
                   legend: {
                        show: true
                   }

        });

what did i make here to get half chart i given almost full height and full width

Это было полезно?

Решение

SOLVED

Your max value is clipping your chart.

max: (new Date("2013/9/09")).getTime(),
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top