Announcement

Collapse
No announcement yet.

help with highchart..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • help with highchart..

    Hi all , i need some little help , i need it to let it ready my csv file .
    i already put the code in it but it doesnt work.

    the aspx opens just fine but cant find my csv.
    and i also need to add somewehere the line splitter code..


    Lines to split

    Code:
    $.get('temperature.csv', function(data) {
    // Split the lines
    var lines = data.split('\n');
    $.each(lines, function(lineNo, line) {
    var items = line.split(';');



    The aspx :

    Code:
    <%@ Page Language="VB" %>
    <script runat="server">
    
    '***********API Homeseer access*************
    
    Dim hs As Scheduler.hsapplication
    Dim plugin As HomeSeerAPI.PluginAccess
    
    Sub Page_Load(Sender As Object, E As EventArgs)
    ' ***for using HS functions with the HS web server
    hs = Context.Items("Content")
    end sub
    
    '***************************************
    '***functions to retrieve the banners and menus on top of the Homeseer page
    Private Function GetHeadContent() As String
    Try
    Return hs.GetPageHeader("", "Temperature", "", "", False, False, True, False, False)
    Catch ex As Exception
    End Try
    Return ""
    End Function
    
    Private Function GetBodyContent() As String
    Try
    Return hs.GetPageHeader("", "Temperature", "", "", False, True, False, True, False)
    Catch ex As Exception
    End Try
    Return ""
    End Function
    '***************************************
    </script>
    <!DOCTYPE HTML>
    <html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    		<title>Highcharts Test</title>
    
    		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    		<style type="text/css">
    ${demo.css}
    		</style>
    		<script type="text/javascript">
    $(document).ready(function() {
        $.get('temperature.csv', function(data) {
    			
    
            $('#container').highcharts({
                chart: {
                    zoomType: 'x'
                },
                title: {
                    text: 'Temperature test'
                },
                subtitle: {
                    text: document.ontouchstart === undefined ?
                            'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
                },
                xAxis: {
                    type: 'datetime'
                },
                yAxis: {
                    title: {
                        text: 'Test temp'
                    }
                },
                legend: {
                    enabled: false
                },
                plotOptions: {
                    area: {
                        fillColor: {
                            linearGradient: {
                                x1: 0,
                                y1: 0,
                                x2: 0,
                                y2: 1
                            },
                            stops: [
                                [0, Highcharts.getOptions().colors[0]],
                                [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
                            ]
                        },
                        marker: {
                            radius: 2
                        },
                        lineWidth: 1,
                        states: {
                            hover: {
                                lineWidth: 1
                            }
                        },
                        threshold: null
                    }
                },
    
                series: [{
                    type: 'area',
                    name: 'Test file',
                    data: data
                }]
            });
        });
    });
    		</script>
    	</head>
    	<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9"> 
    <!--[if IE]><script src="excanvas.js"></script><![endif]-->
    <!--***writes the header calling the above function-->
    <%response.write(GetHeadContent())%>
    <!--***store a style for the div you are going to use as a container for your chart-->
    <style type = "text/css"> #graphdiv{position:absolute; left: 2em; top: 5em; right: 2em; bottom: 1em; height:auto; max-width:1000px;}</style>
    
    </head>
    	<body>
    <script src="https://code.highcharts.com/highcharts.js"></script>
    <script src="https://code.highcharts.com/modules/exporting.js"></script>
    
    <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
    
    	</body>
    </html>
    thanks and kind regards
    Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
    Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




    HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

  • #2
    Where is the temperature.csv located? On the server? You are using client side JQuery to attempt to open the file and you've given no path nor included the file so JQuery can't find it.
    -Rupp
    sigpic

    Comment


    • #3
      hi rupp

      its located on my server , in the same folder as the aspx

      regards

      Originally posted by Rupp View Post
      Where is the temperature.csv located? On the server? You are using client side JQuery to attempt to open the file and you've given no path nor included the file so JQuery can't find it.
      Preferred -> Jon's Plugins, Pushover, Phlocation, Easy-trigger,
      Rfxcom, Blade Plugins, Pushbullet, homekit, Malosa Scripts




      HS3Pro 3.0.0.531 on windows 7 ultimate X64 on hp quadcore laptop 8 GB.

      Comment

      Working...
      X