Jump to content
Software FX Community

NullReferenceException when Legend is placed inside Plot Area


Recommended Posts

Have you checked when the NullReferenceException occurs? I tested placing the legend inside using XAML

<cfx:Chart Name="chart1" Border="{x:Static cfx:Borders.Classic}" Palette="{x:Static cfx:Palettes.Basic}" Style="{x:Static cfxmotifs:Simple.Style}">   <cfx:Chart.LegendBox>   <cfx:LegendBox cfx:Chart.TargetPanel="Inside" HorizontalAlignment="Right" VerticalAlignment="Top"/>   </cfx:Chart.LegendBox></cfx:Chart> 

I also tried using code in the Page_loaded method instead of XAML as follows

Chart.SetTargetPanel(chart1.LegendBox, "Inside");chart1.LegendBox.HorizontalAlignment = HorizontalAlignment.Right;chart1.LegendBox.VerticalAlignment = VerticalAlignment.Top;

Both ways worked fine. If you try any of these and they fail you might want to download our most recent hotfix.


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.

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