private void Initialize() { double width = 0; double height = 0; if (CurrentStyle.ContainsKey("height")) { var pixelHeight = CurrentStyle["height"]; if (pixelHeight.EndsWith("px")) { height = Convert.ToDouble(pixelHeight.TrimEnd("px".ToCharArray())); } } if (CurrentStyle.ContainsKey("width")) { var pixelWidth = CurrentStyle["width"]; if (pixelWidth.EndsWith("px")) { width = Convert.ToDouble(pixelWidth.TrimEnd("px".ToCharArray())); } } if (width > 0 && height > 0) { widthAndHeightAreSet = true; Width = width; Height = height; } }
private void Initialize() { double width = 0; double height = 0; if (CurrentStyle.ContainsKey("height")) { var pixelHeight = CurrentStyle["height"]; if (pixelHeight.EndsWith("px")) { height = Convert.ToDouble(pixelHeight.TrimEnd("px".ToCharArray())); } } if (CurrentStyle.ContainsKey("width")) { var pixelWidth = CurrentStyle["width"]; if (pixelWidth.EndsWith("px")) { width = Convert.ToDouble(pixelWidth.TrimEnd("px".ToCharArray())); } } if (width > 0 && height > 0) { widthAndHeightAreSet = true; Width = width; Height = height; CategoryScale.Output = new ScaleRange { Start = MarginLeft, End = Width.Value - MarginRight }; ValueScale.Output = new ScaleRange { Start = Height.Value - MarginBottom, End = MarginTop }; } }