Jump to content
Software FX Community
jamaljna

Bar Graph x-axis text to legend? only 1 series

Recommended Posts

Hi,

 The result set used for my bar graph only produces 1 series. But I want each value on the x-axis to be represented in the legend instead of being all grouped under the name of series 0. Is there a way to do this?

For example, my query returns

 FruitGroup Count------------- --------- Apples   10Grapes   2

 

But instead of "Apples" and "Grapes" showing up in legend box,  I only get "FruitGroup", with both Apples and Graphes represented in the same color in the graph (I know I can use Multiple Colors option to fix this part).

 

Thanks

Share this post


Link to post
Share on other sites

Whenever you set MultipleColors to true, the legendbox displays the Axis X Labels. So I think you get the desired effects just by doing that.

DataTable table1 = new DataTable("Test");

table1.Columns.Add(

"FruitGroup", System.Type.GetType("System.String"));table1.Columns.Add("Count", System.Type.GetType("System.Double"));

table1.Rows.Add(

new object[] { "Apples", 10 });table1.Rows.Add(new object[] { "Grapes", 2 });

chart1.DataSourceSettings.Fields.Add(

new FieldMap("FruitGroup", FieldUsage.Label));chart1.DataSourceSettings.Fields.Add(new FieldMap("Count", FieldUsage.Value));

chart1.DataSource = table1;

chart1.Gallery =
Gallery.Bar;

chart1.AllSeries.MultipleColors =

true;

 

---

Andre G

Share this post


Link to post
Share on other sites

 The thread you linked to is for Chart FX for Client Server 5.1. This thread is for Chart FX for Reporting Services. I am assuming you want the solution for Client Server, since there is no API in Chart FX for Reporting Services. I will reply on the correct forum.

Share this post


Link to post
Share on other sites

Hi Andre,

I want the Bars on X-Axis to be colored based on thier groups. Is it possible?

For eg. I want 1st and 3rd Bar in Red color and 2nd and 4th in blue color.

about:/forums/C:\Users\tusc0704\Desktop\SampleChart.jpg

Share this post


Link to post
Share on other sites

Hi Andre,

I also wnat help in my another issue.

In my application(Same Chart) I am using Series 0 as Bar chart and Series 1 For Line Chart.

but problem is my points of line charts (i.e. values) gets hidden by Bar chart means it goes behind the Bar Chart.

and if I add the line Series[0].SendToBack() then the tooltip of the Bars show wierd data (i.e tooltip shows PC instead of showing %)

Plz reply fast if possible as I need urgent help on this.

Thanking u in Advance.

Regards

Sunil

Share this post


Link to post
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.

Loading...

×
×
  • Create New...