Telerik Forums
UI for WinForms Forum
4 answers
261 views
Hi we are evaluating telerik controls for use in our application.

Problem:   The series won't change colors when the color is set at runtime.



Background:
I'm using ChartFX Winforms 2009 Q2

I am creating a solution where a chart is embedded in a Grid cell. 
I use the grid.cellformatting event to set the grid image if the rowinfo tag has not been set, much like is suggested in the telerik sample for: Multiple child views with RadGridView for WinForms

To simplify the test, I just default the series bar value to: "series.Appearance.FillStyle.MainColor = Drawing.Color.Green " (see bulleted line in code block below)

Eventually I need to add a piece of code that will set the series color based on the value.  For now I have just defaulted the value to show as green.

I have referenced other posts in the forum and added the lines to updategraphics, refresh, and still could not get the series to turn green.

Code:
    Private _chart As New RadChart 

 Private Sub PrepareChart() 
        Dim radChart As New GridToleranceChart 
        Me._chart = radChart.chart 
        Me._chart.SkinsOverrideStyles = False 
    End Sub 
GridToleranceChart is a usercontrol that has a radchart on it.  I use an instance of this usercontrol, and reference its public chart property, so I could set some visual elements at designtime.  PrepareChart is called when the form loads.
   


Private Sub grid_CellFormatting(ByVal sender As Object, _ 
        ByVal e As CellFormattingEventArgs) _ 
        Handles grid.CellFormatting 
 
        Dim column As GridViewDataColumn = TryCast(e.CellElement.ColumnInfo, GridViewImageColumn) 
        If column IsNot Nothing AndAlso StrComp(column.FieldName, _ 
            Constants.DefaultToleranceColumnNames.TolPercentChart, CompareMethod.Text) = 0 Then 
 
 
            If e.CellElement.RowInfo.Tag Is Nothing Then 
                Me._chart.Series.Clear() 
 
                column.Width = 300 
                column.AllowResize = False 
                e.CellElement.RowElement.RowInfo.Height = 60 
 
                Dim series As New Telerik.Charting.ChartSeries() 
  •              series.Appearance.FillStyle.MainColor = Drawing.Color.Green 
                series.Type = Telerik.Charting.ChartSeriesType.Bar 
                series.Name = "percentOfTolSeries" 
                series.Appearance.LabelAppearance.Visible = False 
 
                ' Get the value to add to the series from another cell in the same row of the cell that is being edited 
                ' Add the value to the series 
                Dim rowInfo As GridViewRowInfo = TryCast(e.CellElement.RowInfo, GridViewDataRowInfo) 
                Dim value As Decimal = CDec(rowInfo.Cells(Constants.DefaultToleranceColumnNames.PercentOfTol).Value) 
                series.Items.Add(New Telerik.Charting.ChartSeriesItem(value)) 
 
            
                Me._chart.Series.Add(series) 
 
                Me._chart.Refresh() 
                Me._chart.Update() 
                Me._chart.UpdateGraphics() 
                e.CellElement.RowInfo.Tag = Me._chart.GetBitmap() 
            End If 
 
            e.CellElement.Image = TryCast(e.CellElement.RowInfo.Tag, System.Drawing.Image) 
            e.CellElement.ImageLayout = ImageLayout.Center 
 
            e.CellElement.DrawBorder = False 
            e.CellElement.Text = "" 
            e.CellElement.Padding = New Padding(0, 0, 0, 0) 
        End If 
    End Sub 

Your help is greatly appreciated.
Hristo
Telerik team
 answered on 25 May 2017
1 answer
21 views
Incorrect behavior of the line at the beginning and at the end at identical values
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Sep 2016
7 answers
110 views
Hi,

I'm trying to programmatically change the fill colour of the series on my chart and for some reason I'm not getting it to work.

This is the code I'm currently using.

radChart1.SkinsOverrideStyles = false;
            chartSeries.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient;
            chartSeries.Appearance.FillStyle.FillSettings.GradientMode = Telerik.Charting.Styles.GradientFillStyle.Horizontal;
            chartSeries.Appearance.FillStyle.MainColor = Color.FromArgb(255, 55, 96, 145);
            chartSeries.Appearance.FillStyle.SecondColor = Color.FromArgb(255, 184, 204, 228);
  
            radChart1.UpdateGraphics();

Obviously I'm either missing something or the above code is completely wrong, can someone help please?

Regards,

Guy
Dimitar
Telerik team
 answered on 10 Mar 2016
4 answers
271 views
I'm using RadChart v2011.3.11.1219 with a .Net 4.0 WinForms app using VS 2010 sp1. In this app I am displaying a couple of charts, but I am wondering if it is possible to generate a line chart and save it to png without ever displaying the chart?

How would I go about doing that?
Stefan
Telerik team
 answered on 03 Mar 2016
5 answers
145 views

Hello Team Telerik,

I want to ask how can I have a 3D chart. How can I do this?

Is there a property which set the chart in a 3D mode?

Another Problem I have is that I cant add a radLabel to a radGroupBox programatically.

Thanks very much

Kind regards,

Alfonsina

Stefan
Telerik team
 answered on 26 Jan 2016
8 answers
123 views
Hello

I have installed telerik 2011 Q2 however when i try find my chart to drag onto my winform there is no RadChart to drag on.
Am I looking in the wrong place or what is going wrong.

Thanks
Stef
Telerik team
 answered on 03 Nov 2014
1 answer
12 views
Hi all

I have three questions:

First :I use telerik chart to create a chart for my
application. I want to insert column and row sum of chart data table below the
chart (the same as last column and row in attached image).I do it manually. Is
it possible to do it automatically?

Second:As you can see in the attached image, The last column
is the total sum of row.Is it possible that the last column shows just the
value not bar chart?

 

Third:is it possible to remove colored bullet  of total last row  from legend?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Aug 2014
7 answers
232 views
Is it possible to allow a user to choose the chart type at run time, say from a drop down box.
I can obviously see the choices in the chart wizard in design but can't see how to code it.
*Using VB2005*

Cheers,
Gary
Stefan
Telerik team
 answered on 17 Jul 2014
1 answer
88 views
I am using an older version of the RadControls (2011.3.1115.40). I would like to save the charts to jpeg format. I have a button on the form which invokes the following event: 

        protected void btnSaveChar_OnClick(object sender, EventArgs e)
        {
            RadChart1.Save(Server.MapPath("~/files/chart.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg); 
        }

This definitely saves the chart, but its a blank chart with the label "There is no or empty series". What do I need to do to save the chart as it is displayed on the webform? 

Thanks! 
Ivan Petrov
Telerik team
 answered on 30 Dec 2013
6 answers
198 views
I have a Windows Forms application (C# .NET 3.5) which uses RadChart and RadMenu controls (version 2009.1.9.311).  I can build and run the application on the build machine (Windows 7 64-bit), but it crashes immediately when run it on any other Windows 7 64-bit PC.  I created a new test application with nothing except one RadChart and it also crashes immediately.  As soon as I click on the executable it displays the standard Windows "[program] has stopped working" error with the choice to check online for a solution or close the program.  The original application has the following details "Problem Event Name: APPCRASH; Fault Module Name: KERNELBASE.dll; Fault Module Version: 6.1.7600.16385; Exception Code: e0434f4d; Exception Offset: 000000000000aa7d; OS Version: 6.1.7600.2.0.0.256.4".  The test application only as a few details which might be useful: "Problem Event Name: CLR20r3; Problem Signature 03: 4call1179b; (PS 06 is the same); Problem Signature 07: 1; Problem Signature 08: 15; Problem Signature 09: System.IO.FileNotFoundException; OS Version: 6.1.7600.2.0.0.256.4".  I can create a similar test application with non-Telerik controls and do not get the error on other Win 7 x64 PCs.

Has anyone else experience similar issues?  Is there a solution / workaround?

Thanks,
Chris
Oleg
Top achievements
Rank 1
 answered on 05 Dec 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
DropDownList
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Form
PageView
MultiColumn ComboBox
TextBox
Menu
RichTextEditor
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
Tabstrip (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
CAB Enabling Kit
TabbedForm
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ImageEditor
ScrollBar
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Barcode
Styling
ColorBox
PictureBox
Callout
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
CalculatorDropDown
Localization
TimePicker
ValidationProvider
FontDropDownList
Licensing
BreadCrumb
ButtonTextBox
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?