Score/Time chart with Office Web Component (OWC)

Last post 02-28-2007 12:48 PM by cosmo0. 0 replies.

Sort Posts:

  • Score/Time chart with Office Web Component (OWC)

    02-28-2007, 12:48 PM
    • Member
      101 point Member
    • cosmo0
    • Member since 05-02-2006, 10:48 AM
    • Paris
    • Posts 39

    Hello !

    I want to draw a chart with the Office Web Component. I read many articles (on 4guys, csharphelp etc), but found no "official" documentation and/or example. And I'm struggling to find how I can do what I want.

    Here is the code I use for generating a (test) chart :

    1                Dim Graphique As New ChartSpace
    2                Dim Graph As ChChart = Graphique.Charts.Add()
    3                With Graph
    4                    .Type = ChartChartTypeEnum.chChartTypeScatterLineMarkers
    5                    .HasLegend = False
    6                    .HasTitle = True
    7                    .Title.Caption = "Results of learner"
    8                    .Axes(0).HasTitle = True
    9                    .Axes(0).Title.Caption = "Results"
    10                   .Axes(1).HasTitle = True
    11                   .Axes(1).Title.Caption = "Exercices"
    12               End With
    13   
    14               Dim GraphSeries As ChSeries = Graph.SeriesCollection.Add(0)
    15               GraphSeries.SetData(ChartDimensionsEnum.chDimSeriesNames, ChartSpecialDataSourcesEnum.chDataLiteral, "Score")
    16               GraphSeries.SetData(Owc11.ChartDimensionsEnum.chDimXValues, Owc11.ChartSpecialDataSourcesEnum.chDataLiteral, "01-2007" & vbTab & "02-2007" & vbTab & "03-2007" & vbTab & "04-2007")
    17               GraphSeries.SetData(Owc11.ChartDimensionsEnum.chDimYValues, Owc11.ChartSpecialDataSourcesEnum.chDataLiteral, Math.Floor(Rnd() * 10).ToString & vbTab & Math.Floor(Rnd() * 10).ToString & vbTab & Math.Floor(Rnd() * 10).ToString & vbTab & Math.Floor(Rnd() * 10).ToString)
    18   
    19               Response.ContentType = "image/gif"
    20               Response.BinaryWrite(Graphique.GetPicture("gif", 500, 400))
    21               Response.End()
    

    But on the X axis, there are still the values 0, 1, 2 etc ! It doesn't cares that I gave him dates...
    How can I put other values on the X axis than arbitrary numbers ?

    Thanks very much ! 

    Filed under: ,
Page 1 of 1 (1 items)