Announcement

Collapse
No announcement yet.

DataVisualization dll

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

    DataVisualization dll

    I tried to use the .NET system.web.DataVisualization with Mono on Linux and it always errored. I ended up using other charting library for Linux, but would prefer to have logic for only one in my plugin. Reading your excellent doc on this plugin I see you included the system.web.datavisualization.dll explicitly. Did you compile a specific version of it to overcome Mono shortcoming?

    #2
    What kind of errors did you run into? I didn't do anything special - I'm just using it as-is.

    Comment


      #3
      I was getting some Mono error about some X... package. When I try to reproduce the error now I get no feedback in the system log or my debug. To aid with debug I created a wrapper around the actual routine that uses the charting library. The debug shows I get to the the point in the wrapper that prints "MakeChart". It does not print "MakeChart2" or "MakeChartExit". I have catch trap in MakeChart2 as well as others higher up in the calling stack, but no catch trap is executed.

      What I determined is that when the MakeChart2 function is brought into context the thread exits. Since the thread is one that gets recreated every two seconds as part of the AJAX callback it has no ill-effects other than no chart being drawn. In Windows environment the .NET charting library works as expected.

      I'm running Mono 5.4.1.7 under Debian Jessie on a Odroid C1.

      Code:
        Private Function MakeChart(ByVal Y1Info As ChartInfo, Y2Info As ChartInfo, iReturn As ReturnTypes) As String
              hsWritelog(PLUGIN_DEBUG, "MakeChart")
              Return MakeChart2(Y1Info, Y2Info, iReturn)
              hsWritelog(PLUGIN_DEBUG, "MakeChartExit")
          End Function
      
          Private Function MakeChart2(ByVal Y1Info As ChartInfo, Y2Info As ChartInfo, iReturn As ReturnTypes) As String
              'Data in in files Line1.dat and Line2.dat if two are being drawn
              hsWritelog(PLUGIN_DEBUG, "MakeChart2")
              Dim sY1 As String = ""
              Dim sY2 As String = ""
      
              Try
                  Dim Chart1 As New System.Web.UI.DataVisualization.Charting.Chart  
                  hsWritelog(PLUGIN_DEBUG, "MakeChart2A")

      Comment


        #4
        That's strange... I wonder if it has anything to do with the frequency with which you're calling it? I'm also not trying to display the chart itself, if that makes any difference; I set it all up then use SaveImage to write it to a file.

        Code:
            Friend Function CreateChart( _
                ByRef objParms As ChartParameters,
                ByVal strFileName As String,
                ByRef tblHistory As HistoryData.ValueChangeHistoryDataTable,
                ByVal blnDisplaySize As Boolean) As String
        
                Dim objPrimaryDeviceSettings As DeviceSettings
        
                Dim chrtHistory As System.Web.UI.DataVisualization.Charting.Chart

        Comment


          #5
          I moved the instantiation to the public area of the module and got the following in the HS log.

          Code:
          Getting web page from plugin page MQTT Setup:Could not load type of field 'HSPI_MCSMQTT.MQTTASP:Chart1' (41) due to: Could not load file or assembly 'System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type: member:
          To overcome this I copied this .dll from my Windows Framework folder to \bin\mcsMQTT and it is happy now. Thank you for helping me along with this.

          Comment


            #6
            Originally posted by Michael McSharry View Post
            I moved the instantiation to the public area of the module and got the following in the HS log.

            Code:
            Getting web page from plugin page MQTT Setup:Could not load type of field 'HSPI_MCSMQTT.MQTTASP:Chart1' (41) due to: Could not load file or assembly 'System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. assembly:System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type: member:
            To overcome this I copied this .dll from my Windows Framework folder to \bin\mcsMQTT and it is happy now. Thank you for helping me along with this.
            Glad to hear it! Hope it works out well for your plugin.

            Comment

            Working...
            X