Solved

ASP.net VB.net Java error on page load

Posted on 2014-02-08
4
444 Views
Last Modified: 2014-02-09
ASP.net VB.net Java error on page load

1

Imports System.Drawing
Imports System.Data.SqlClient

Imports System.Web.UI.DataVisualization.Charting.Series
Imports System.Web.UI.DataVisualization.Charting
Imports System.Web.UI.DataVisualization.Charting.DataPointCustomProperties


Public Class DataVisualization
    Inherits System.Web.UI.Page

    Dim _Separator As String = "."

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
             oChart
            'oLoad_Web_Layout_Data()
            ' Call Test()
        End If
    End Sub
    Sub oChart()
        ' Initialize the Chart object    
        Dim chart1 As New Chart()
        chart1.ID = "chart1"

        'Add to do code here
        If Not IsPostBack Then
            ' Initialize objects and elements
            Dim chartArea1 As New ChartArea()
            Dim legend1 As New Legend()
            Dim series1 As New Series()
            Dim series2 As New Series()
            Dim series3 As New Series()

            ' Set the Chart Properties
            chart1.Width = 340
            chart1.Height = 340

            chart1.Palette = ChartColorPalette.EarthTones
            chart1.Palette = ChartColorPalette.Fire
            chart1.BackColor = System.Drawing.Color.Gray
            chart1.BorderSkin.SkinStyle = BorderSkinStyle.Emboss

            chart1.BorderLineColor = System.Drawing.Color.Gray
            chart1.BorderlineDashStyle = ChartDashStyle.Solid
            chart1.BorderLineWidth = 4

            ' Set the ChartArea properties
            chartArea1.Name = "Default"
            chartArea1.BackColor = System.Drawing.Color.Gray

            'Enable AJAX features such as zooming and scrolling for the ChartArea
            'chartArea1.CursorX.UserEnabled = True
            'chartArea1.CursorY.UserEnabled = True
          
            ' Add the ChartArea to the Chart
            chart1.ChartAreas.Add(chartArea1)

            ' Set the Legend properties
            legend1.Name = "Default"
            legend1.Docking = Docking.Bottom
            legend1.LegendStyle = LegendStyle.Row
            legend1.Alignment = System.Drawing.StringAlignment.Center

            legend1.BackColor = System.Drawing.Color.Transparent
            legend1.BorderColor = System.Drawing.Color.Black
            legend1.BorderWidth = 1

            ' Add the Legend to the Chart
            chart1.Legends.Add(legend1)

            ' Set the Series properties
            series1.BorderColor = System.Drawing.Color.DarkSlateGray
            series1.Name = "Series1"
            series1.ChartType = SeriesChartType.SplineArea

            series2.BorderColor = System.Drawing.Color.DarkSlateGray
            series2.Name = "Series2"
            series2.ChartType = SeriesChartType.Column

            series3.Name = "Series3"
            series3.BorderWidth = 3
            series3.ChartType = SeriesChartType.Spline

            ' Add the Series to the Chart
            chart1.Series.Add(series1)
            chart1.Series.Add(series2)
            chart1.Series.Add(series3)

            ' Add points to each series.
            Dim rnd As New Random()

            For Each ser As Series In chart1.Series
                For i As Integer = 0 To 12
                    ser.Points.AddY(rnd.[Next](5, 40))
                Next
            Next

            'Preserve the chart's state during callbacks
            'chart1.CallbackStateContent = CallbackStateContent.All
        End If

        ' You MUST add the Chart to a form. By default, form1 is created on aspx pages.
        Me.form1.Controls.Add(chart1)
    End Sub

Open in new window

0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 39844020
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39844103
What is your question?
0
 

Author Comment

by:murbro
ID: 39845482
Sorry I thought I had typed a question. I am running the VB.net code shown above and getting a strange error shown in the image. What might cause this
0
 

Author Closing Comment

by:murbro
ID: 39845527
Thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.Net Report Printing Issue 3 32
Disable extension 8 37
Datagridview column when exported to Excel changes vb.net 1 13
going to wrong jsp page 2 19
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question