Jump to content
Software FX Community

Conditional Attributes Legend


Smartie

Recommended Posts

Heya,


I am currently converting some charts from Chart FX Internet 6.2 to a Chart FX 7.



CHART 1

--------------------------


This chart has one series and the bars are coloured depending on their value. Here is the code for the 6.2 version:


Dim ConditionAbove

Set ConditionAbove = Chart.ConditionalAttributes(0)

ConditionAbove.Color = RGB(HexToRGB(Request.Form("GraphRange1Colour"),"R"),HexToRGB(Request.Form("GraphRange1Colour"),"G"),HexToRGB(Request.Form("GraphRange1Colour"),"B"))

ConditionAbove.Condition.From = Request.Form("GraphRange1From")

ConditionAbove.Condition.To = Request.Form("GraphRange1To")

ConditionAbove.Legend = "Above Target"

ConditionAbove.MarkerSize = 5


The above code would also populate the user legend box. So I used to hide the series legend box and show the user legend box. All was well and happy.


In Chart FX 7 I have been un-able to find any reference to a user legend box or been able to set up something similar.



CHART 2

--------------------------


This chart has mulitple series and has a coloured background. Here is the Chart FX 6.2 code for the background colouring:


Dim StripeAbove

Set StripeAbove = Chart.Stripes(0)

StripeAbove.From = Request.Form("GraphRange1From")

StripeAbove.To = Request.Form("GraphRange1To")

StripeAbove.Color = RGB(HexToRGB(Request.Form("GraphRange1Colour"),"R"),HexToRGB(Request.Form("GraphRange1Colour"),"G"),HexToRGB(Request.Form("GraphRange1Colour"),"B"))

StripeAbove.Axis = AxisItem_Y


Chart.UserLegendBoxObj.Item(0).Label = "Above Target"

Chart.UserLegendBoxObj.Item(0).Color = RGB(HexToRGB(Request.Form("GraphRange1Colour"),"R"),HexToRGB(Request.Form("GraphRange1Colour"),"G"),HexToRGB(Request.Form("GraphRange1Colour"),"B"))


As you can see it adds the stripe and then adds it in the user legend box. This chart display two legends, one at the bottom for the series' and one to the right for the background ranges. Once again I cannot find the user legend.


---------------------


Has it been renamed to something strange, or hidden inside another object within the chart.


Any help is greatly welcomed.


Really not impressed that I had to edit my post and add br tags to the end of each line -.-

Link to comment
Share on other sites

Thanks for the reply, shame the new version has less functionality. :(


I am adding the conditional attributes in the new version as follows:


pChart.ConditionalAttributes.Add(New ChartFX.WebForms.ConditionalAttributes(pReport.Range1From, pReport.Range1To, Drawing.ColorTranslator.FromHtml(pReport.Range1Colour)))


These are not showing up in the legend automatically, nor am I able to name them.


How would I do this?


Also regarding the stipes on the backgrounds... I am adding them like this:


pChart.AxisY.Sections.Add(New ChartFX.WebForms.AxisSection(pReport.Range1From, pReport.Range1To, Drawing.ColorTranslator.FromHtml(pReport.Range1Colour)))


How do I add them to the legend also?

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...