Forum Replies Created by gtsafas

Viewing 3 posts - 1 through 3 (of 3 total)
  • in reply to: Excluding Date on X Axis when no data #12549

    I modified one of your demos below. See how there is only 3/1 and 3/5. I only want to see 3/1 and 3/5 on the x axis. I cant seem to find a setting to do that.

    <!DOCTYPE HTML>
    <html>
    <head>
      <script type="text/javascript">
      window.onload = function () {
        var chart = new CanvasJS.Chart("chartContainer",
        {
          title:{
            text: "Date time axis with interval 3 months"
          },
          axisX:{
            interval: 0,
            intervalType: "day"
          },
          data: [
          {
            type: "line",
            dataPoints: [//array
            {
             x: new Date(2012, 03, 1),
             y: 26,
           },
           {
             x: new Date(2012, 03, 5),
             y: 38
           }
        
           ]
         }
         ]
       });
    
        chart.render();
      }
      </script>
      <script type="text/javascript" src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
    </head>
    <body>
      <div id="chartContainer" style="height: 300px; width: 100%;">
      </div>
    </body>
    </html>
    in reply to: Excluding Date on X Axis when no data #12543

    Hi Sunil,

    I am not allowed to share screenshots and jsfiddle is blocked here. Let me try to explain better.

    Assuming the following is true,
    1) I have a stacked column graph
    2) My x-axis is a date
    3) I have data for Jan 1st, Jan 3rd, Jan 4th

    When my graph is rendered it is showing me along the x-axis labels

    Jan 1st, Jan 2nd, Jan 3rd, Jan 4th

    I do not have any data for Jan 2nd and I dont see it being passed anywhere on my side. Additionally, if I mouse over the gap that Jan 2nd creates I dont get a tooltip, so that leans me even more towards the fact that I am not causing this.

    If you guys have an email we can correspond over it, I can share SS there.

    Thanks for any help

    in reply to: dataAnimationIterationEnd #9519

    Also why can we not get a ref to the internal chart apis? I get you don’t want them public but it would be really useful.

    Could we not get a ref to _chart here?
    Chart: function (containerId, options) {
    var _chart = new Chart(containerId, options, this);

    this.render = function () { _chart.render(this.options) };
    //console.log(_chart);
    this.options = _chart._options;
    },

Viewing 3 posts - 1 through 3 (of 3 total)