Jump to content
Software FX Community

ChartFX-Lite Using Month of the date as the Axis/Legend


Jeffulot

Recommended Posts

I'm trying to get the month names along the X axis.

In my attempts, I either get a few months and then no more get shown, or just no months.

My data has no specific number of items in each month... I'm just trying to program a trigger to set a new month for the corresponding data above it.  It would work pretty easy if I have one data item for each month I guess.

Is there a way to make it work the way I'm needing it to? I've been looking at the exmaples and cannot determine how.

 

Here is my code as it dies not try to display the months.

 

 With Chart1   .ToolBar = False   .Gallery = Gallery.Lines   .Border = True   .AxisY.Max = 2000   .AxisY.Min = 100   .Chart3D = False   .Grid = ChartGrid.Horz Or ChartGrid.Vert   .OpenData(COD.Values, 4, 12)   While sdr.Read   If MonthName(Month(sdr.Item("kitty_date"))) <> usemonth Then   usemonth = MonthName(Month(sdr.Item("kitty_date")))   .Legend(month_counter) = usemonth   month_counter = month_counter + 1   End If   .Value(0, yval) = sdr.Item("total_kitty")   yval = yval + 1   End While   .CloseData(COD.Values) 'It requires to import SoftwareFX.ChartFX.Lite   End With

Link to comment
Share on other sites

I tried to reproduce your code, but I dont really know what your data looks like. But one thing I noticed is that you call OpenData saying you will have 4 series, but you never add data beyond series index 0. Also, are you trying to add more than one point on the same series on the same tickmark? Because that is only possible using X values, which Chart FX Lite does not support. Any other version of Chart FX does.

---

AndreG

Link to comment
Share on other sites

Thank you for responding....

 I'll take a look...

Are there any barebones examples of using dates along the bottom axis?  I'm trying to understand how your software works, and up to that point it was quite easy.  I'm not understanding the "Series" aspects of it I think.

Jeff

 

Link to comment
Share on other sites

You can't really have a "Date Axis" in this version of Chart FX (again a Lite limitation that is possible in other versions). I made you a very simple sample of what you can do, I hope it solves some of your questions. Also, if you do find you need more functionality, take a look at this website. It shows a comparison between the product you are currently using and our other versions of Chart FX (mouse over topics to reveal details).

http://www.softwarefx.com/WhyUpgrade/comparison.aspx

 ---

Dim r As New Random

Dim month(12) As String

month(0) = "Jan"

month(1) = "Feb"

month(2) = "Mar"

month(3) = "Apr"

month(4) = "May"

month(5) = "Jun"

month(6) = "Jul"

month(7) = "Aug"

month(8) = "Sep"

month(9) = "Oct"

month(10) = "Nov"

month(11) = "Dec"

Chart1.Gallery = SoftwareFX.ChartFX.Lite.Gallery.Lines

Dim iSeries As Integer

Dim iPoint As Integer

' Pass Values

Chart1.OpenData(SoftwareFX.ChartFX.Lite.COD.Values, 4, 12) ' 4 series (in this case 4 lines), 12 points

For iSeries = 0 To 3

 For iPoint = 0 To 11

Chart1.Value(iSeries, iPoint) = r.Next(0, 100)

 Next iPoint

Next iSeries

Chart1.CloseData(SoftwareFX.ChartFX.Lite.COD.Values)

' Create the labels for X axis

Dim i As Integer

For i = 0 To 12

 Chart1.Legend(i) = month(i)

Next i

---

 AndreG

Link to comment
Share on other sites

Did you try the code I posted? Each line would represent a series.

Suppose you have the following data, representing the productivity score of 4 employees throught the year:

Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

34, 67, 53, 58, 97, 78, 96, 54, 47, 27, 69, 79

97, 83, 23, 11, 28, 26, 84, 5, 93, 52, 95, 84

54, 35, 24, 79, 39, 39, 73, 7, 64, 57, 24, 2

44, 32, 26, 58, 63, 67, 27, 29, 17, 17, 69, 62

As you can see, each row represents an employee. Each column represents a month. So if you would like to put that in a chart you might use 4 series (one for each employee) and 12 points (one for each month). That way you would have 4 lines, one for each employee. Kinda like what you get when u run the code I posted before.

Thats the most basic concept of series. Now, different galleries use series in a different way. For instance a bubble chart (not supported by the Lite version) would use the first series for position of bubble and second series for size of bubble. A pie chart would draw one pie per series (althought I think more than one pie is not possible in the Lite version). Sorry for all the information that might not apply to your product, but I think it would help you grasp the concept.

I hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...