<div id="chartdiv" style="width: 100%; height: 400px; background-color: #FFFFFF;" ></div>

    <script type="text/javascript">

			AmCharts.makeChart("chartdiv",

				{

					"type": "serial",

					"categoryField": "category",

					"startDuration": 1,

					"categoryAxis": {

						"gridPosition": "start"

					},

					"trendLines": [],

					"graphs": [

						{

							"balloonText": "[[title]] :₹[[value]]",

							"fillAlphas": 1,

							"id": "AmGraph-1",

							"title": "Profit",

							"type": "column",

							"valueField": "column-1"

						},

						{

							"balloonText": "[[title]] :₹[[value]]",

							"fillAlphas": 1,

							"id": "AmGraph-2",

							"title": "Loss",

							"type": "column",

							"valueField": "column-2"

						}

					],

					"guides": [],

					"valueAxes": [

						{

							"id": "ValueAxis-1",

							"title": "Profit/Loss"

						}

					],

					"allLabels": [],

					"balloon": {},

					"legend": {

						"enabled": true,

						"useGraphSettings": true

					},

					"titles": [

						{

							"id": "Title-1",

							"size": 15,

							"text": "Daily Profit/Loss Chart"

						}

					],

					"dataProvider": [<?php //$d=date("d");//echo date($d."-m-Y");

					$this->db->group_by("bsday");

					$this->db->where("monthyr",$dm);
					$this->db->where("pro_loss!=",'');

					$ddd=$this->db->get("buysell")->result();

					//print_r($ddd);

					foreach($ddd as $dd){

						  $this->db->select_sum('pro_loss');  

						  $this->db->where("pro_loss<",0); 

						  $this->db->where("bsday",$dd->bsday); 

						  $loss=$this->db->get('buysell')->row();

						  

						  $this->db->select_sum('pro_loss');  

						  $this->db->where("pro_loss>",0); 

						  $this->db->where("bsday",$dd->bsday); 

						  $profit=$this->db->get('buysell')->row();?>

						{

							"category": "<?php echo date("d-M",strtotime($dd->bsday));?>",

							"column-1": <?php echo $profit->pro_loss;?>,

							"column-2": <?php echo $loss->pro_loss;?>

						},<?php }?>

					]

				}

			);

		</script>
        