Jump to content
Software FX Community

Need help with chartfx7, stacked bar chart, Link and Parameters


apaje
 Share

Recommended Posts

Hi, I am trying to customize the link for each bar in my stacked bar chart.  Using the Parameters $N and $S I can get the point and series values respectively.  What I need is to pass in the guid ID value I have that is part of my DataTable datasource, but I fear that the ID is never included anywhere in the rendered code and I cannot find a way to get this ID as a parameter to set in my link.url value.

For a little more background, we have a ChartFX7 license, my chart is rendered as an image and is bound to a DataTable with columns: ID, number, Series1, Series2, Series3, Series4.  The actual values would look like this:

GuidID1, 24, A, null, null, null

GuidID1, 2, null, null, C, null

In the code behind I am setting the link.url property for my points, but I need to pass the ID value as a parameter to destination.  Any help would be greatly appreciated!

Link to comment
Share on other sites

Hi,

When binding data to the Component, Chart FX will only take values and Labels for the DataSource. In other words, only labels and datapoints can be passed. It is not possible to directly bind ny kind of metadata directly from your Data Table.

One way I see of working around this would be to loop through all the Chart's points after the Databinding is done and assign the Guid to each point by using its Text property. Afterwards you can use the %L Parameter to in order to add the content of the Text property to your URL's string:

for

(int j; j < chart1.Data.Points;j++ ) chart1.Points[0, j].Text = myGuid[j];

Hope this helps.

 Regards, 

TT

 

Link to comment
Share on other sites

Thanks for the response, I will definitely give that a try.  What I ended up doing was using the Click event to get the ID.  Since I really need to stay on the same page, a postback works fine, although I might try your suggestion in case we decide to use a javascript call and make it more asynchronous.

void Chart1_Click(object sender, HitTestEventArgs e){int point = e.Point;string idString = ((ChartFX.WebForms.Chart)(sender)).Points[point].Tag.ToString();}

I do have another question though related.  In a stacked chart, I have multiple series linked by a common ID.  The click event is only triggered when clicking on a bar in the chart.  Is it possible to make the labels below the axis for the related stacked bars a link?  I cannot find way to do this.  The applicability in our case is for seeing the underlying data for the related stacked bars in a grid when clicking this link.

 

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.

 Share

×
×
  • Create New...