Hi, I'm working on an app asp.net and using radchart control in it, I wrote the next test code:
HTML
vb.net code
this code showed the bar chart correctly, but When I changed the ChartSeriesType to Pie, the graphics is not shown, (see image attached).
When I comment the next code:
I get the next exception
Unable to cast object of type 'Telerik.Charting.ChartXAxis' to type 'Telerik.Charting.ChartYAxis'.
regardless if the ChartSeriesType is Bar or Pie, I get the error.
What am I doing wrong?
This is my web.config file:
This problem didn't happen when I used the build 2012_1_215, this problem ocurred to me with the build 2012_2_918
any help solving this topic is appreciate, I need purchase this controls immediately.
kind regards.
HTML
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
div
>
<
telerik:RadChart
ID
=
"chrChart"
runat
=
"server"
>
<
PlotArea
>
<
EmptySeriesMessage
Visible
=
"True"
>
<
Appearance
Visible
=
"True"
>
</
Appearance
>
</
EmptySeriesMessage
>
</
PlotArea
>
</
telerik:RadChart
>
</
div
>
</
form
>
vb.net code
Protected
Sub
Page_Load(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
Me
.Load
chrChart.Clear()
chrChart.AutoLayout =
True
chrChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font =
New
Font(
"Arial"
, 10)
chrChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = Color.Black
chrChart.PlotArea.XAxis.AutoScale =
False
Dim
loDataSeries
As
New
ChartSeries(
"Chart test"
, ChartSeriesType.Bar)
loDataSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels
Dim
myItem1
As
New
ChartSeriesItem(10,
"myitem1"
)
myItem1.Name =
"myitem1"
Dim
myItem2
As
New
ChartSeriesItem(20,
"myitem2"
)
myItem2.Name =
"myitem2"
loDataSeries.AddItem(myItem1)
loDataSeries.AddItem(myItem2)
chrChart.AddChartSeries(loDataSeries)
End
Sub
this code showed the bar chart correctly, but When I changed the ChartSeriesType to Pie, the graphics is not shown, (see image attached).
Dim
loDataSeries
As
New
ChartSeries(
"Chart test"
, ChartSeriesType.PIE)
When I comment the next code:
'chrChart.PlotArea.XAxis.AutoScale = False
I get the next exception
Unable to cast object of type 'Telerik.Charting.ChartXAxis' to type 'Telerik.Charting.ChartYAxis'.
regardless if the ChartSeriesType is Bar or Pie, I get the error.
What am I doing wrong?
This is my web.config file:
<?
xml
version
=
"1.0"
?>
<
configuration
>
<
appSettings
>
<
add
key
=
"Telerik.Skin"
value
=
"Metro"
/>
<
add
key
=
"Telerik.ScriptManager.TelerikCdn"
value
=
"Disabled"
/>
<
add
key
=
"Telerik.StyleSheetManager.TelerikCdn"
value
=
"Disabled"
/>
</
appSettings
>
<
system.web
>
<
compilation
debug
=
"true"
strict
=
"false"
explicit
=
"true"
targetFramework
=
"4.0"
>
<
assemblies
>
<
add
assembly
=
"System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
<
add
assembly
=
"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"
/>
<
add
assembly
=
"System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
/>
</
assemblies
>
</
compilation
>
<
pages
>
<
controls
>
<
add
tagPrefix
=
"telerik"
namespace
=
"Telerik.Web.UI"
assembly
=
"Telerik.Web.UI"
/>
</
controls
>
</
pages
>
<
httpHandlers
>
<
add
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.DialogHandler.aspx"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
validate
=
"false"
/>
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
</
httpHandlers
>
<
httpModules
>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
/>
</
httpModules
>
</
system.web
>
<
system.webServer
>
<
validation
validateIntegratedModeConfiguration
=
"false"
/>
<
modules
runAllManagedModulesForAllRequests
=
"true"
>
<
remove
name
=
"RadCompression"
/>
<
add
name
=
"RadCompression"
type
=
"Telerik.Web.UI.RadCompression"
preCondition
=
"integratedMode"
/>
</
modules
>
<
handlers
>
<
remove
name
=
"ChartImage_axd"
/>
<
add
name
=
"ChartImage_axd"
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
remove
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
/>
<
add
name
=
"Telerik_Web_UI_SpellCheckHandler_axd"
path
=
"Telerik.Web.UI.SpellCheckHandler.axd"
type
=
"Telerik.Web.UI.SpellCheckHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
remove
name
=
"Telerik_Web_UI_DialogHandler_aspx"
/>
<
add
name
=
"Telerik_Web_UI_DialogHandler_aspx"
path
=
"Telerik.Web.UI.DialogHandler.aspx"
type
=
"Telerik.Web.UI.DialogHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
remove
name
=
"Telerik_RadUploadProgressHandler_ashx"
/>
<
add
name
=
"Telerik_RadUploadProgressHandler_ashx"
path
=
"Telerik.RadUploadProgressHandler.ashx"
type
=
"Telerik.Web.UI.RadUploadProgressHandler"
verb
=
"*"
preCondition
=
"integratedMode"
/>
<
remove
name
=
"Telerik.Web.UI.WebResource"
/>
<
add
name
=
"Telerik.Web.UI.WebResource"
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
preCondition
=
"integratedMode"
/>
</
handlers
>
</
system.webServer
>
<
location
path
=
"Telerik.Web.UI.WebResource.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"*"
/>
</
authorization
>
</
system.web
>
</
location
>
<
location
path
=
"ChartImage.axd"
>
<
system.web
>
<
authorization
>
<
allow
users
=
"*"
/>
</
authorization
>
</
system.web
>
</
location
>
</
configuration
>
This problem didn't happen when I used the build 2012_1_215, this problem ocurred to me with the build 2012_2_918
any help solving this topic is appreciate, I need purchase this controls immediately.
kind regards.