0

So I am currently making a line chart that it's date will be called from my db. The Problem is that the DAYS are kept repeated like this. enter image description here

I want to keep the days single only like this rather than doubled. : 11Feb2018 12Feb2018 13Feb2018 14Feb2018

Javascript(Views):

dataPoints: [
 <?php foreach ($result1 as $row) { ?>
  <?php echo'{x:new Date('.$row->data1.','.$row->data2.','.$row->data3.'), 
y:'.$row->data4.'},'?>
 <?php } ?>
]

Controller:

$data['result1'] = $this->madminpathologyweekly->get_result1()->result();
$this->load->view('vadminpathologyweekly',$data);

Model:

public function get_result1() {
    $sql = "SELECT year as data1,month_of_the_year - 1 as data2, day_of_the_month as data3,";
    $sql .= "COUNT(test_id) as data4 from TBLSUBMITTEDREQUEST group by year ,month_of_the_year, day_of_the_month";
    $query = $this->db->query($sql);
    return $query;
}
1
  • so group by day_of_the_month is not working ? Commented Feb 15, 2018 at 6:25

1 Answer 1

1

So I did a deeper research and I found out that I missed an interval type: and interval: in axis x like this.

axisX: {
        valueFormatString: "DD MMMM YYYY",
        intervalType: "day",
        interval: 1,
       },

Cheers guys. I've already solved it. Thanks for your time.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.