Information to Chart Caption
Kettic UI ASP.NET AJAX Chart SDK offers users both the mature chart creation controls and chart element customizing tools, which mainly include chart title, axes, series, ticks, plot area, axis label, legend and so on. In this article, we are about to talk about how to add title to chart and how to have post-modifications within ASP.NET application, the only thing you need is add the reference to Kettic Asp.net UI control DLL.
The title for a chart can highly displays the theme and contents of chart which is controlled by the chart caption component. With the full web ASP.NET UI chart APIs and methods, developers and end users are capable of adding a certain title to chart, defining the title appearance, setting title dimensions and fill style, rotating title as well as positioning title to left, right, center, top, bottom alignment mode, etc. With robust ChatTitle object, users can be enabled to modify and format title text, title marker and title overall appearance. Besides the primary title, Kettic Chart control allows you to insert a subtitle just below the primary one.
Following contents show the specific chart title properties of ChartTitle control, besides, the complete sample asp.net codes are provided.
- ActiveRegion: this component contains properties for HTML Attributes, Tooltip and URL. When we move mouse to title and suspend, we can see Tooltip tool. And we can go to the target web page if we have a click. See following demo codes.
<Caption ActiveRegion-Tooltip="Kettic Chart Caption" ActiveRegion-Url="www.kettic.com" >
- StyleSet: appearance includes many sub-attributes for title, for instance, visibility, Border, Corners, Dimensions, Fill, Position, Rotation Angle, font, size, format and Shadow. Use FillStyle object to select the title filled type, text color and background color. The Potion term can allow users to change and define the title position to Left, Right, Center, Top, Bottom, BottomRight, BottomLeft, TopRight and TopLeft. In addition, set the Visible property as True to show the title. Sample asp.net codes below show how to set these properties.
<TextArea StyleSet-Border-PenStyle="Solid" StyleSet-Border-Color="AliceBlue" StyleSet-Border-Visible=true StyleSet-Border-Width="2"
StyleSet-Fill-FillMode="Gradient" StyleSet-Fill-PrimaryColor="BurlyWood" StyleSet-Fill-SecondColor="LightSeaGreen" >
Here we want to show the details of how to change the title style using C# code in aspx.cs. Maybe developers like using C# to change these properties more.
KaxChart1.Caption.StyleSet.RotationAngle = 30;
KaxChart1.Caption.TextArea.StyleSet.Border.PenStyle = System.Drawing.Drawing2D.DashStyle.Solid;
KaxChart1.Caption.TextArea.StyleSet.Border.Color = System.Drawing.Color.AliceBlue;
KaxChart1.Caption.TextArea.StyleSet.Border.Visible = true;
KaxChart1.Caption.TextArea.StyleSet.Border.Width = 2;
KaxChart1.Caption.TextArea.StyleSet.Fill.FillMode = ChartFillMode.Gradient;
KaxChart1.Caption.TextArea.StyleSet.Fill.PrimaryColor = System.Drawing.Color.BurlyWood;
KaxChart1.Caption.TextArea.StyleSet.Fill.SecondColor = System.Drawing.Color.LightSeaGreen;
- TextArea: TextArea property enables users to set the would-be displayed text style, such as text font, text size and background. Please refer to asp.net sample codes below.
<TextArea Text="Chart Caption" StyleSet-TextSurface-Color="Red">
In addition to above complete sample codes, we also show a sample image of chart title here, which is created by using the provided demo ASP.NET codes. And of course, according to different settings, the created title image can be variable. It all depends on your own requirements.Lick to chart caption setting by using C# codes