Juny,
Thanks for your code! I re-created your the NullReference exception exactly, because the feature.ColumnValues["data"] value is null and the conversion is failed. There is a workaround for this issue, please refer the following code:
public class MyClassBreakStyle : ClassBreakStyle
{
public MyClassBreakStyle(string columnName)
:base(columnName)
{}
protected override void DrawCore(System.Collections.Generic.IEnumerable<Feature> features, GeoCanvas canvas, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInThisLayer, System.Collections.ObjectModel.Collection<SimpleCandidate> labelsInAllLayers)
{
System.Collections.ObjectModel.Collection<Feature> newFeatures = new System.Collections.ObjectModel.Collection<Feature>();
foreach (Feature feature in features)
{
if (feature.ColumnValues[this.ColumnName]== null)
{
feature.ColumnValues.Remove(this.ColumnName);
feature.ColumnValues.Add(this.ColumnName, string.Empty);
}
newFeatures.Add(feature);
}
base.DrawCore(newFeatures, canvas, labelsInThisLayer, labelsInAllLayers);
}
}
Please add the custom class above to your sample and use the MyClassBreakStyle to instead of the ClassBreakStyle when calling the ClassBreakStyle object. Then it will bypass the NullReference exception.
Any more questions please let me know again,
Thanks,
Scott,