Home Forums Chart Support DATE in xValue – Don’t SHOW- JSP

DATE in xValue – Don’t SHOW- JSP

Viewing 2 posts - 1 through 2 (of 2 total)
  • #39528

    SELECT FORMAT (b.time, ‘yyyy-MM-dd’) as date, SUM(b.total) as total
    FROM tblBill b JOIN tblStatus s ON b.statusID = s.statusID
    WHERE b.statusID = 4
    GROUP BY FORMAT (b.time, ‘yyyy-MM-dd’)
    Order by FORMAT (b.time, ‘yyyy-MM-dd’) asc

    <%
    Gson gsonObj = new Gson();
    Map<Object, Object> map = null;
    List<Map<Object, Object>> list = new ArrayList<Map<Object, Object>>();
    String dataPoints = null;
    try {
    Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”);
    Connection connection = DriverManager.getConnection(“jdbc:sqlserver://localhost:1433;databaseName=NestF;instanceName=SQLEXPRESS”, “sa”, “123”);
    Statement statement = connection.createStatement();
    String xVal, yVal;
    ResultSet resultSet = statement.executeQuery(“SELECT FORMAT (b.time, ‘yyyy-MM-dd’) as date, SUM(b.total) as total FROM tblBill b JOIN tblStatus s ON b.statusID = s.statusID WHERE b.statusID = 4 GROUP BY FORMAT (b.time, ‘yyyy-MM-dd’) Order by FORMAT (b.time, ‘yyyy-MM-dd’) asc”);
    while (resultSet.next()) {
    xVal = resultSet.getString(“date”);
    yVal = resultSet.getString(“total”);
    map = new HashMap<Object, Object>();
    map.put(“x”, java.util.Date.parse(xVal));
    map.put(“y”, Float.parseFloat(yVal));
    list.add(map);
    dataPoints = gsonObj.toJson(list);
    }
    connection.close();
    } catch (SQLException e) {
    }
    %>

    #39533

    @danialtien,

    Can you kindly upload the sample project reproducing the issue you are facing to Google-Drive or Onedrive & share the link with us so that we can run it locally to understand the scenario better and help you out?

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact scenario, or the solution that we provide may not work properly due to the variation in chart options being used by you and us.

    Having a sample project helps us in figuring out the issue and suggesting an appropriate solution accordingly.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.