public void test() { LineSeries line1 = new LineSeries() { }; for (int i = 0; i < 10; i++) { line1.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Value = i }); } line1.MouseLeftButtonDown += (sender, args) => MouseLeftDown(sender, args, chart1); chart1.Series.Add(line1); } public void MouseLeftDown(object sender,MouseButtonEventArgs args,RadCartesianChart chart) { }chart[i].HorizontalAxis= new LinearAxis() { LabelInterval = 10 }; [TypeConverter(typeof(LineTypeConverterNoExpand)), GlobalizedCategory("Misc"), GlobalizedDisplayName("LineType"), GlobalizedDescription("Get/Set the vdLinetype object that the vdFigure will be drawn with."), ScriptSerialize]
public vdLineType LineType
{
get
{
return this.mLineType;
}
set
{
if ((this.mLineType != value) && base.RaiseOnBeforeModify("LineType", value))
{
if ((!this.Deleted && (value != null)) && value.Deleted)
{
value.Deleted = false;
}
base.AddHistory("LineType", value);
this.mLineType = value;
base.RaiseOnAfterModify("LineType");
}
}
}
namespace VectorDraw.Professional.vdPrimaries
{
using System;
using System.ComponentModel;
using System.Globalization;
using VectorDraw.Professional.Utilities;
using VectorDraw.Professional.vdObjects;
public class LineTypeConverterNoExpand : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (context == null)
{
return false;
}
return ((sourceType == typeof(string)) || base.CanConvertFrom(context, sourceType));
}
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string)
{
try
{
string name = (string) value;
vdDocument document = TypeConverterUtilities.getDocument(context);
object solid = null;
if (document != null)
{
solid = document.LineTypes.FindName(name);
}
if (solid == null)
{
solid = document.LineTypes.Solid;
}
return solid;
}
catch
{
throw new NotSupportedException("Can not convert '" + ((string) value) + "' to type LineType");
}
}
return base.ConvertFrom(context, culture, value);
}
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
vdDocument document = TypeConverterUtilities.getDocument(context);
if (document == null)
{
return new TypeConverter.StandardValuesCollection(new string[0]);
}
return new TypeConverter.StandardValuesCollection(document.LineTypes.GetNotDeletedItemsAndVisibleOnForms());
}
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
}
}