This is a migrated thread and some comments may be shown as answers.

Legend Disappears on Postback

7 Answers 199 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 14 Mar 2008, 10:14 AM

Hi,
Im using Promethus RAD chart. In my user control, I have three charts which are dynamically binding and im having different legend for different charts.

In my ascx, i have this much code and im doing all the things in code behind.

<telerik:radchart ID="RadChart1" SkinsOverrideStyles="false" runat="server" Width="600px" Height="430px" seriespalette="" visible="false" >

<PlotArea>

<Appearance dimensions-width="470" > </Appearance>

</PlotArea>
</telerik:radchart>
Legend Creation in code behind:

Dim lbl1 As New LabelItem

With RadChart1.Legend.Items(0)

.TextBlock.Text =

"81 to 100% - Appraisal criteria fully met"

.Marker.Appearance.FillStyle.MainColor = Drawing.Color.Green

.Marker.Appearance.FillStyle.SecondColor = Drawing.Color.GreenYellow

.TextBlock.Appearance.TextProperties.Color = Color.Black

End With

Dim lbl2 As New LabelItem

With RadChart1.Legend.Items(1)

.TextBlock.Text =

"41 to 80% - Appraisal criteria partially met"

.Marker.Appearance.FillStyle.MainColor = Drawing.Color.Yellow

.Marker.Appearance.FillStyle.SecondColor = Drawing.Color.Silver

End With

With RadChart1.Legend

.AddLabel(lbl1)
 .AddLabel(lbl2)

.Appearance.Position.AlignedPosition = Styles.AlignedPositions.BottomLeft

.Appearance.Location = Styles.LabelLocation.OutsidePlotArea

RadChart1.Legend.Visible =

True

End With

IN the ascx control, i have combo box with the chart types... when the user changes the chart type and click refresh , then the next chart is loaded. but when the user just changes the chart type alone, then nothing should happen.

actual result :  when the user changes the chart type, chart remains the same..but legend text and marker diasppears completely leaving blank white space. but when i click refresh, then legend comes properly.

Is there a way to keep the legend as it is when the user changes the chart type in combo box.

Could you pls.

Thanks

7 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 18 Mar 2008, 02:15 PM
Hello Bidan,

It seems, you have hit a bug in RadChart - custom legend item properties are lost on postback. I have notified our developers of this issue. We are sorry for the inconvenience caused. For the time being - you need to make sure that the legend item's properties are set each time the chart is shown in the page.

Your Telerik points have been updated.

Greetings,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
jjroman
Top achievements
Rank 2
answered on 10 Jun 2008, 08:03 PM
Hi, Has this bug been fixed? I have a similar error: the first time (not postback) my labels are ok but after postback i have only labels with the names: item 1, item 2. I refresh my chart control but I think it lost the name of the items. I refresh the control with the next function:

Private Sub InitRadChart2()

Dim dr As SqlDataReader = Siprodata.getReporte1ForChart(ddMeses.SelectedValue, Session("UsuarioCodigoSiprodata"))

'RadChart2.DataGroupColumn = "Monto"

RadChart2.DataManager.LabelsColumn =

"Operaciones"

' Set the series type

RadChart2.DefaultType = Telerik.Charting.ChartSeriesType.Pie

' Set the data source

RadChart2.DataSource = dr

' Refresh data

RadChart2.DataBind()

'RadChart2.Series(0).Appearance.ShowLabels = True

'RadChart2.Series(0).DefaultLabelValue = "#ITEM #%"

'' Asignando el formato de las etiquetas

For Each it As ChartSeriesItem In RadChart2.Series(0).Items

it.Label.TextBlock.Text =

"#ITEM (#%)"

Next

'Set additional chart properties and settings.

RadChart2.ChartTitle.TextBlock.Text =

"Operaciones en el mes: " + ddMeses.SelectedItem.Text

End Sub 'InitRadChart2

0
Ves
Telerik team
answered on 11 Jun 2008, 01:47 PM
Hello jjroman,

I am afraid this code does not show any possible reason for such behavior. Can you please send us in a formal support ticket a small runnable page which reproduces the issue? You can replace the datareader with a datatable. Thanks.

Regards,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Lance
Top achievements
Rank 1
answered on 08 Jan 2010, 10:19 PM
I too am experiencing these symptoms; this time with the skin, and the appearance.emptyvalue.line.color settings.  Can you verify if this is a bug for these specific settings?  This is on 2009 Q3 SP1.
0
Ves
Telerik team
answered on 13 Jan 2010, 12:03 PM
Hello Lance,

Yes, the same issue exists for the EmptyValue settings. Make sure you retrieve and configure the correct series on each postback.

Regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Katie Arnott
Top achievements
Rank 1
answered on 05 Feb 2010, 04:42 PM
custom legend item properties are lost on postback.

has this issue been fixed?  I am too experiencing the disappearing of my legend text on postback, although it is being set every time.

Thank you,
Katie
0
Ves
Telerik team
answered on 09 Feb 2010, 08:31 AM
Hi Katie,

I am afraid this has not been fixed. Can you send us an example, showing the issue with disappearing legend items, even though they are generated on each postback. We will review it and will get back to you with our findings. Thanks.


Best regards,
Ves
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Chart (Obsolete)
Asked by
John
Top achievements
Rank 2
Answers by
Ves
Telerik team
jjroman
Top achievements
Rank 2
Lance
Top achievements
Rank 1
Katie Arnott
Top achievements
Rank 1
Share this question
or