Chart x and y axis max at 1

3 posts, 1 answers
  1. Stephen
    Stephen avatar
    8 posts
    Member since:
    Jul 2013

    Posted 28 Aug 2013 Link to this post

    I've been playing with the bubble charts recently.  
    When using static data, there is no problem, but when connecting to my dataset the maximum values for both x and y are set to 1.

    When this happens my visuals are off screen. 
    If I set the axis majorUnit to 5000, some of my categories become visible.. but I have no grid lines displayed other than 0 and 5,000.
    BaseUnitStep: "fit" or "auto" have no effect.

    Thanks,
    -Stephen

  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 30 Aug 2013 Link to this post

    Hi Stephen,

    In order to avoid similar issues I will suggest changing axes max values depending on the data (for this purpose setOptions can be used). For example:  

    var chart = $("#chart").data("kendoChart");
    chart.setOptions({ yAxis: { max: 200000 } });
    chart.refresh();
    Regards,
    Iliana Nikolova
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Answer
    Stephen
    Stephen avatar
    8 posts
    Member since:
    Jul 2013

    Posted 04 Sep 2013 Link to this post

    Actually, defining a schema resolved this almost perfectly.

    $("#chart").kendoChart({
      dataSource: {
        data: reportResult,
     
        schema: {
          model: {
            fields: {
              Category    : { type: "string" },
              Revenue    : { type: "number" },
              GP        : { type: "number" },
              Quantity        : { type: "number" },
              SubCategory    : { type: "string" },
              Store        : { type: "string" },
            }
          }
        }
      }
    });

    This way, the chart sets the max dynamically.
Back to Top