Downloaded... installed.. all ok.
I decided to try to replicate one of my existing graphs in the site, in order to see if I liked the new graph engine (and to see if it was faster than the sluggish old one).
PROBLEM: as soon as I put a new graph control on a form and try to compile (from inside my existing site), I get the error above ('ChartSeries' is ambiguous in the namespace 'Telerik.Charting') and many others similar.
Is this ambiguity with the older version ?
Please tell me I do *not* have to remove the older version from my site, before I can run the new one?
(I do hope that is NOT the case, because Telerik make claim about the fact that the newer and older controls can reside together - it is specifically mentioned).
Steve
PS Yes, I have read the thread below: but it is not clear to me - I was advised when I found bugs in the older Chart that the engine was being completely re-written.
So why would I want to continue to use the older DLL (engine?)... or is it still the old engine?
What I wish to do is run the 2 (i.e. new and old) side-by-side.
RadChart for ASP.NET AJAX Q2 2008 | Send comments on this topic. |
Telerik.Charting. |
Troubleshooting > Telerik.Charting. |
Glossary Item Box
When upgrading existing telerik RadControls applications (which include RadChart) to RadControls for ASP.NET AJAX you may get the following error:
Error 1 The type 'Telerik.Charting.<SomeType> exists in both 'c:\WINDOWS\assembly\GAC_MSIL\Telerik.Charting\...\Telerik.Charting.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\...\RadChart.Net2.DLL'
The reason for this error is because RadChart (3.x and later) and RadControls for ASP.NET AJAX Chart use shared code.he shared code is in the form of Telerik.Charting.dll assembly which is ILMerged in the RadChart.Net2.dll for backwards compatibility reasons and is shipped separately for RadControls for ASP.NET AJAX.
The error will manifest itself whenever you attempt to reference BOTH RadChart.Net2.dll and Telerik.Charting.dll. There are two ways to resolve the issue:
- If you are migrating your projects to use RadControls for ASP.NET AJAX you may initially want to remove the reference to the Telerik.Charting.dll from your Web.config file. In this case you will be using the old ASP.NET Chart and will not need the Telerik.Charting.dll that comes with the suite. The Telerik.Charting.dll is NOT required for the operation of the for ASP.NET AJAX controls other than Chart.
- If you are already using RadChart for ASP.NET AJAX then you will need to remove the reference to RadChart.Net2.dll and continue using Telerik.Charting.dll
Please have in mind that RadChart for ASP.NET AJAX and RadChart 4.x have 99% identical functionality. It is up to your personal preference to decide which one you would like to use. The most significant difference is the assembly name and the fact that RadChart for ASP.NET AJAX uses an HttpHandler to display images and RadChart 4.x still uses RadControls\Image.aspx for backwards compatibility reasons.
18 Answers, 1 is accepted
Unfortunately you are right. While the classic ASP.NET controls are compatible with their Web.UI versions the case you describe is an exception. There was one other customer who reported this problem. I don't like giving templated answers so I will directly link to my response there.
If you are going to migrate to the new Web.UI Chart our support team will be more than willing to assist you with all issues.
Please, accept my sincere apologies for this situation.
Kind regards,
Vladimir Milev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Can you double-clarify for me, then:
- that I simply CANNOT run the old graph engine and new engine side-by-side in the same site.
- that the graph engine HAS been re-written and is 'better' than the previous one (i.e quicker, fewer bugs, etc)
- that to test the 2 against each other I will have to make a duplicate site, and in that second site remove all refs to the Q1 07 chart and replace with the Q2 08 chart; then run the 2 'sites' (graphs) against each other!!
Yes?
I do hope this isn't a typical example of 'progress' to ASP.NET Ajax.....
cheers
Steve
I said : "that to test the 2 against each other I will have to make a duplicate site, and in that second site remove all refs to the Q1 07 chart and replace with the Q2 08 chart; then run the 2 'sites' (graphs) against each other"
I have made my copy site.... I have removed the *new* DLL from the 'Bin' folder of the old site - BUT STILL THE OLD SITE WON'T RUN GRAPHS using existing Q1 07 controls... same errors reported.
It looks as if I have now corrupted the (existing) site, AND THE ONLY WAY TO FIX IT IS TO COMPLETELY UNINSTALL THE Q2 08 CONTROLS from my development computer!
This is ridiculous - to have to uninstall the new controls, and then attempt to try them on another development machine... (maybe)
Is this the best we can do?
Please advise.
Steve
Let me start with the first batch of questions:
1) No, you cannot run classic RadChart for ASP.NET with RadChart from Telerik.Web.UI side by side.
2) The engine in RadChart for ASP.NET versions 4.x is basically the same as the one in Telerik.Web.UI. The releases are synced with the same engine code for the past few Q releases. RadChart 3.x is not compatible with the above two (this one uses the old engine code)
3) Although RadChart 4.x and recent releases of Telerik.Web.UI are basically the same (with the exception of the zooming and scrolling feature which is implemented only in the Telerik.Web.UI chart) you may test how the Web.UI chart will behave by simply removing the reference to RadChart.Net20.dll and adding references to Telerik.Web.UI.dll and Telerik.Charting.dll. You will then need to update the code to compile correctly if you are upgrading from 3.x. Please follow these guidelines when upgrading from RadChart classic to Web.UI.
About the errors you are encountering:
These are occuring because you cannot have more than one reference to the Telerik.Charting.dll. This assembly exists in two forms:
-As a separate DLL file "Telerik.Charting.dll"
-Merged inside RadChart.Net20.dll
In order to avoid the error you will need to remove references to either one of them. If you have a website check BOTH your bin folder and Web.config file for references to the assemblies in GAC.
Kind regards,
Vladimir Milev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for the info - I still had a ref. to the Charting assembly in the 'old' site web.config, as you indicated may be the case. I have removed it and I can now run the old site again (phew.. that was really worrying me!)
Have got the old graph engine and new one working on the same data, in separate sites. But obviously the way the new Chart works is quite different - see these graphs:
This is what I am trying to emulate: http://203.110.155.14/Image1.png
I have used exactly the same code for the second graph, and used the Backward Compatibility section to update to the new class structures.
But clearly you guys have made many, many changes - because this is not even close to the original! http://203.110.155.14/Image2.png
I'm thinking that this is going to be a *lot* of work, and I may be wasting my time... (this is a complex graph).
I am inclined to leave it... *except* of course that if I ever want to add more graphs to this site, they must be added in the 3.x engine... (or in another manufacturer's tools).
But thanks for the help in getting it going
Steve
There are numerous improvements which can help you make the chart look better easily in the new engine.
For starters: try this. It is a new feature which will help with the spacing and layout.
When customizing the appearance you may want to try out some of our default skins which look nice. When dealing with skins you will find this property to be really useful.
If the default skins are not good enough for you then you should look here for further details on how to style the RadChart control.
Hopefully you will be able to achieve a nice looking chart in a couple of minutes. Let us know if we can help you further.
Greetings,
Vladimir Milev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I still have a number of things not working correctly.
This code transfers data to the chart:
With RadChart1 |
.Series.Clear() |
Dim DT As DataTable = ProcessProductSalesDT() |
.DataSource = DT |
Select Case rblGraphType.SelectedValue |
Case "QS" |
.PlotArea.YAxis.AxisLabel.TextBlock.Text = "SALES QTY." |
Dim valuesarray As String() = {"SalesQty"} |
.DataManager.ValuesYColumns = valuesarray |
Case "SV" |
.PlotArea.YAxis.AxisLabel.TextBlock.Text = "SALES VALUE ($)" |
Dim valuesarray As String() = {"SalesValue"} |
.DataManager.ValuesYColumns = valuesarray |
End Select |
.DataGroupColumn = "SizeLabel" |
.PlotArea.XAxis.DataLabelsColumn = "Description" ' ie Product Name |
.PlotArea.YAxis.AutoScale = True |
.PlotArea.YAxis.AxisLabel.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Center |
.PlotArea.YAxis.Appearance.LabelAppearance.Dimensions.Margins = 20 |
.Skin = "LightBrown" '.Palette = "Gradient" ' Colorful / Gradient / Classic / Stacked / Rainbow |
With .Appearance |
.Border.Color = System.Drawing.ColorTranslator.FromHtml("#005447") |
.Border.Width = 1 |
End With |
.Appearance.Shadow.Distance = 3 |
.Appearance.Shadow.Blur = 5 |
.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45 |
Dim F As System.Drawing.Font |
F = New System.Drawing.Font(.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font.Name, 6, Drawing.FontStyle.Regular) |
.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = F |
Dim U As Telerik.Charting.Styles.Unit = New Telerik.Charting.Styles.Unit(30, Telerik.Charting.Styles.UnitType.Percentage) |
.PlotArea.Appearance.Dimensions.Margins.Bottom = U |
U.Value = 12 |
.PlotArea.Appearance.Dimensions.Margins.Right = U |
U.Value = 10 |
.PlotArea.Appearance.Dimensions.Margins.Left = U |
U.Value = 12 |
.PlotArea.Appearance.Dimensions.Margins.Top = U |
.DataBind() |
SetSeriesColours() |
.Visible = True |
End With |
and this is supposed to colour the sets (simple block colours, repeating every 15):
Protected Sub SetSeriesColours() |
For idx As Int16 = 0 To (RadChart1.Series.Count - 1) |
RadChart1.Series(idx).Appearance.ShowLabels = False |
With RadChart1.Series(idx).Appearance |
Select Case idx Mod 15 ' repeat every 15 |
Case 0 |
.FillStyle.MainColor = Drawing.Color.ForestGreen |
Case 1 |
.FillStyle.MainColor = Drawing.Color.Blue |
Case 2 |
.FillStyle.MainColor = Drawing.Color.Gold |
Case 3 |
.FillStyle.MainColor = Drawing.Color.Red |
Case 4 |
.FillStyle.MainColor = Drawing.Color.Cyan |
Case 5 |
.FillStyle.MainColor = Drawing.Color.Fuchsia |
Case 6 |
.FillStyle.MainColor = Drawing.Color.Lime |
Case 7 |
.FillStyle.MainColor = Drawing.Color.LightCyan |
Case 8 |
.FillStyle.MainColor = Drawing.Color.Yellow |
Case 9 |
.FillStyle.MainColor = Drawing.Color.Orange |
Case 10 |
.FillStyle.MainColor = Drawing.Color.LightGray |
Case 11 |
.FillStyle.MainColor = Drawing.Color.LightSkyBlue |
Case 12 |
.FillStyle.MainColor = Drawing.Color.GreenYellow |
Case 13 |
.FillStyle.MainColor = Drawing.Color.Violet |
Case 14 |
.FillStyle.MainColor = Drawing.Color.HotPink |
End Select |
.FillStyle.SecondColor = .FillStyle.MainColor |
.Border.Color = .FillStyle.MainColor |
End With |
Next |
End Sub |
But this is what I get: http://203.110.155.14/Image1.png
Completely wrong colours!
You also suggested that I use the AutoLayout feature - this seems to get 'upset' with 45 degree X-labels: http://203.110.155.14/Image2.png
I look forward to the next 'instalment'.. cheers
Steve
The colors appear to be overridden by the chart palette colors. Please, check your RadChart declaration and make sure you don't define the SeriesPalette property anywhere. Also, please make sure your SkinsOverrideStyles property is set to its default value - false.
About the AutoLayout feature and the axis labels - please use a 90 degree rotation angle as was used in the previous chart you are trying to emulate. Autolayout will work correctly in that case and you will be one step closer to reproducing the original results.
Hope this helps.
Best wishes,
Vladimir Milev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
SeriesPallete *NOT* set (neither in mark-up or code)
SkinsOverrideStyles = false
(Skin=Colorful)
That was the setting of the page as I outlined the probem to you... so issue remains.
Should the AutoLayout not work with 45 degree labels?
(I thought that might be a nice improvement to mu layout, that's all)
Steve
The problem (set colouring) still remains....
Steve
AutoLayout currently does not work well with non-straight angles (i.e. anything different from 0, 90, 180, 270).
About the coloring - I have verified RadChart to correctly apply colors to the series when the properties are set as discussed. Try playing with the fill style of a particular series. If it does not work this means two possible things:
1) The series you are applying them to is cleared/removed from the chart before render.
2) Some other code resets the appearance before render.
I'm afraid that's all I can help with without actually debugging your code, but I can verify that these settings do work and apply correctly.
Hope my response was helpful to you.
Sincerely yours,
Vladimir Milev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
As you advised, I had set:
SeriesPallete *NOT* set (neither in mark-up or code)
SkinsOverrideStyles = false
(Skin=Colorful)
*BUT* "Skin" must also NOT be set!
It also overrides applied colours (despite SkinsOverride Style being false).
HTH
Steve
<add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
Love the tools, but the upgrade path needs more work.
regards,
Dave
Side note:
I found this in Google...
Here are the missing steps that should fix your problem:
1. Delete RadChart.NET2.dll and RadEditor.NET2.dll from the bin directory of your website.
2. Delete Chart and Editor folders from the RadControls directory of your website.
BUT I cannot get rid of the Editor - since you have not offered the same functions in the RadEditor (even though I have asked) - where you provide us the ability to have Submit and Cancel events, etc. Is this the reason?
Old Telerik.Charting Register directive | |
---|---|
<%@ Register Assembly="Telerik.Charting, Version=2.0.5.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763" Namespace="Telerik.Charting" TagPrefix="telerik" %>
|
with this one
New Telerik.Charting Register directive | |
---|---|
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
|
Sorry... sometimes clients push on ridiculous deadlines and it slips by.
Hopefully this will help another..
D.
Thanks for the note. It seems our docs do not make it clear that the Telerik.Charting.dll should be removed from the local Bin folder. I will make sure the relevant help topic is updated.
Best regards,
Ves
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
i am implementing radChart in my project. I want to create ChartSeries at runtime...following is my code
Collection
<SourceOfContact> ObjSourceOfContact = DataServiceProvider.SourceOfContactService.GetFieldName();
Telerik.Charting.
ChartSeries[] chartSeriesCollection = new ChartSeries[ObjSourceOfContact.Count];
for (int i = 0; i < ObjSourceOfContact.Count; i++)
{
Telerik.Charting.
ChartSeries chartSeries = new Telerik.Charting.ChartSeries();
chartSeries[i].Name = ObjSourceOfContact[i].SourceOfContactName;
this.radChart1.Series.AddRange(new Telerik.Charting.ChartSeries[] {(Telerik.Charting.ChartSeries)chartSeries[i] });
}
but the following error is coming at compile time
"Cannot convert type 'Telerik.Charting.ChartSeriesItem' to 'Telerik.Charting.ChartSeries' "
Suggest Me.
Thanks & Regards
Sonu Sharma
i am using Q1 version.
It seems you are trying to add a ChartSeriesItem object to a collection of ChartSeries objects, this seems to come from this line:
this.radChart1.Series.AddRange(new Telerik.Charting.ChartSeries[] {(Telerik.Charting.ChartSeries)chartSeries[i] });
I am not really sure about your specific scenario, but it seems you have to create a single ChartSeries object and then in the loop add a new ChartSeriesItem for every SourceOfContact object.
Sincerely,
Ves
the Telerik team