| ||
SharpPlot Tutorials General Tutorials Chart Samples Style Examples SharpLeaf Tutorials Document Layout Tutorials Text Flow Tutorials Table Tutorials Visual Glossaries SharpPlot Class SharpPlot Properties SharpPlot Structures SharpPlot Enumerations PageMap Class SharpLeaf Reference SharpLeaf Class SharpLeaf Properties SharpLeaf Methods Table Class Table Properties Table Methods SharpLeaf Structures FontType Structure ParagraphStyle Structure BoxStyle Structure SharpLeaf Enumerations DocumentLayout Classes DocumentLayout Class PageLayout Class PageElement Abstract Class Frame : PageElement Class TextBlock : PageElement Class ImageBlock : PageElement Class Box : PageElement Class Rule : PageElement Class Common Reference Document Class VectorMath Class DbUtil Class Download Release Notes Licensing |
SharpPlot Reference > SharpPlot Methods > AddHyperlinks Method SharpPlot.AddHyperlinks MethodSet up hyperlinks for one or more data points or a chart object. Examplesp.AddHyperlinks("http://www.grapl.com"); sp.AddHyperlinks(new string[] {"north.htm","south.htm"}); Overloads
This method is used to make ‘active’ graphics work on your web site. It allows you to associate any URL (typically the address of another page on your site) with a data point on the chart. You may define the jump explicitly by data item, giving the index of the data point in the series, and the target URL. For example: sp.AddHyperlinks("boring.htm",2); sp.DrawPieChart(New int[] {3,2,1}); The second pie slice will show a ‘pointing hand’ in the web browser and when clicked it will route you to the page ‘boring.htm’. To jump to an anchor within the target page add ‘#anchor’ to the tag as usual. To route the jump to a specific frame, add the frame id to the URL, separated with a semi-colon: sp.AddHyperlinks("detail.htm#July;footnote",7); This would be a good way to allow the user to click on the datapoints of a timeseries and see a summary of the numeric information for that datapoint in a second frame below the chart. Setting up multiple linksIf you have a target page for every datapoint, you can omit the item information entirely and simply supply an array of strings, shaped to match your data exactly. sp.AddHyperlinks(new string[] {"North.htm","South.htm"}); This is probably the commonest call to this method, as the array of target pages could be read from a database in the same query as you use to obtain the values. See also ... |