/// <summary> /// 设置TooltipField /// </summary> /// <returns></returns> private string GetTooltipMember() { ChartSeries control = this.ControlHost.Content as ChartSeries; StringBuilder result = new StringBuilder(); bool bindingDataSource = false; Dictionary <string, string> dictProperty = control.GetPropertyBindValue(); if (!IsPreview && control.ExistProperty("TooltipMember") && !bindingDataSource) { string bindPath = control.TooltipMember; string bindProperty = "TooltipMember"; if (!string.IsNullOrEmpty(bindPath)) { string property = string.Empty; if (dictProperty.ContainsKey(bindProperty)) { if (dictProperty.TryGetValue(bindProperty, out property)) { bindProperty = property; } } result.AppendFormat("'{0}'", bindPath); } } return(result.ToString()); }
/// <summary> /// 设置Store /// </summary> /// <returns></returns> private string GetStore() { ChartSeries control = this.ControlHost.Content as ChartSeries; StringBuilder result = new StringBuilder(); bool bindingDataSource = false; Dictionary <string, string> dictProperty = control.GetPropertyBindValue(); if (!IsPreview && control.Bindings.Count > 0) { foreach (var item in control.Bindings) { string bindPath = item.Path == null ? "" : item.Path; string bindProperty = item.Property == null ? "" : item.Property; if (bindProperty.ToLower() == "datasource") { string property = string.Empty; if (dictProperty.ContainsKey(bindProperty)) { if (dictProperty.TryGetValue(bindProperty, out property)) { bindProperty = property; } } if (!string.IsNullOrEmpty(bindPath) && !string.IsNullOrEmpty(bindProperty)) { result.AppendFormat("at('rel:{0}', '{1}').direction(1)", "", bindPath); if (bindProperty.ToLower() == "datasource") { bindingDataSource = true; } } } } } if (!IsPreview && control.ExistProperty("DataSource") && !bindingDataSource) { string bindPath = control.DataSource; string bindProperty = "DataSource"; if (!string.IsNullOrEmpty(bindPath)) { string property = string.Empty; if (dictProperty.ContainsKey(bindProperty)) { if (dictProperty.TryGetValue(bindProperty, out property)) { bindProperty = property; } } result.AppendFormat("at('rel:{0}', '{1}').direction(1)", "", bindPath); } } return(result.ToString()); }