Selasa, 01 Juli 2014

membuat grafik javascript denga dhtmlx

grafik ini bisa diakses dari web pc atau android

<!--conf
<sample>
              <product version="2.6" edition="std"/>
                     <modifications>
                            <modified date="100609"/>
                     </modifications>
               </sample>
 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>Labels</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlxchart.css"/>
<script src="../../../codebase/dhtmlxchart.js"></script>
       
        <script  >



var dataset_colors = [
{ id:1, sales:210, year:"02", color: "#ee4339"},
{ id:2, sales:55, year:"03", color: "#ee9336"},

];
     


</script>
    </head>
    <body >
        <div id="chartDiv" style="width:300px;height:250px;margin:2px"></div>
        <script>
            var chart =  new dhtmlXChart({
                view:"bar",
                container:"chartDiv",
                value:"#sales#",
                label:"#sales#",
                color:"#color#",
                radius:3,
                width:70,
                tooltip:{
                    template:"#sales#"
                },
                xAxis:{
                    title:"Sales per year",
                    template:"'#year#",
                    lines: false
                },
                padding:{
                    left:5,
                    right:5,
                    top:10
                }
            });
            chart.parse(dataset_colors,"json");
        </script>
    </body>
</html>