/// <summary> /// Add a legend with parameters to the chart. /// </summary> public void AddLegend(ChartLegendPosition position, Boolean overlay) { if (Legend != null) RemoveLegend(); Legend = new ChartLegend(position, overlay); ChartRootXml.Add(Legend.Xml); }
internal ChartLegend(ChartLegendPosition position, Boolean overlay) { Xml = new XElement( XName.Get("legend", DocX.c.NamespaceName), new XElement(XName.Get("legendPos", DocX.c.NamespaceName), new XAttribute("val", XElementHelpers.GetXmlNameFromEnum <ChartLegendPosition>(position))), new XElement(XName.Get("overlay", DocX.c.NamespaceName), new XAttribute("val", GetOverlayValue(overlay))) ); }
/// <summary> /// Add a legend with parameters to the chart. /// </summary> public void AddLegend(ChartLegendPosition position, Boolean overlay) { if (this.Legend != null) { this.RemoveLegend(); } this.Legend = new ChartLegend(position, overlay); this.ChartRootXml.Element(XName.Get("plotArea", Document.c.NamespaceName)).AddAfterSelf(Legend.Xml); }
public void AddLegend(ChartLegendPosition position, bool overlay) { if (Legend != null) { RemoveLegend(); } Legend = new ChartLegend(position, overlay); ChartRootXml.Element(XName.Get("plotArea", DocX.c.NamespaceName)).AddAfterSelf(Legend.Xml); }
/// <summary> /// Add a legend with parameters to the chart. /// </summary> public void AddLegend(ChartLegendPosition position, Boolean overlay) { if (Legend != null) { RemoveLegend(); } Legend = new ChartLegend(position, overlay); ChartRootXml.Add(Legend.Xml); }
public ActionResult FirstLook(bool? stack, string seriesType, bool? showTitle, bool? showLegend, ChartLegendPosition? legendPosition) { ViewBag.Stack = stack ?? false; ViewBag.SeriesType = seriesType ?? "bar"; ViewBag.ShowTitle = showTitle ?? true; ViewBag.ShowLegend = showLegend ?? true; ViewBag.LegendPosition = legendPosition ?? ChartLegendPosition.Bottom; return View(SalesDataBuilder.GetCollection()); }
/// <summary> /// Add a legend with parameters to the chart. /// </summary> public void AddLegend(ChartLegendPosition position, Boolean overlay) { if (Legend != null) { RemoveLegend(); } Legend = new ChartLegend(position, overlay); //ChartRootXml.Add(Legend.Xml); // Sourceman: seems to be necessary to keep track of the order of elements as defined in the schema (Word 2013) ChartRootXml.Element(XName.Get("plotArea", DocX.c.NamespaceName)).AddAfterSelf(Legend.Xml); }
/// <summary> /// Sets the legend position /// </summary> /// <param name="position">The legend position.</param> /// <example> /// <code lang="CS"> /// <% Html.Kendo().Chart() /// .Name("Chart") /// .Legend(legend => legend.Position(ChartLegendPosition.Bottom)) /// .Render(); /// %> /// </code> /// </example> public ChartLegendBuilder Position(ChartLegendPosition position) { legend.Position = position; return(this); }
/// <summary> /// Sets the legend position /// </summary> /// <param name="position">The legend position.</param> /// <example> /// <code lang="CS"> /// <% Html.Telerik().Chart() /// .Name("Chart") /// .Legend(legend => legend.Position(ChartLegendPosition.Bottom)) /// .Render(); /// %> /// </code> /// </example> public ChartLegendBuilder Position(ChartLegendPosition position) { legend.Position = position; return this; }
internal ChartLegend(ChartLegendPosition position, Boolean overlay) { Xml = new XElement( XName.Get("legend", DocX.c.NamespaceName), new XElement(XName.Get("legendPos", DocX.c.NamespaceName), new XAttribute("val", XElementHelpers.GetXmlNameFromEnum<ChartLegendPosition>(position))), new XElement(XName.Get("overlay", DocX.c.NamespaceName), new XAttribute("val", GetOverlayValue(overlay))) ); }
/// <summary> /// Add a legend with parameters to the chart. /// </summary> public void AddLegend(ChartLegendPosition position, Boolean overlay) { if (Legend != null) RemoveLegend(); Legend = new ChartLegend(position, overlay); //ChartRootXml.Add(Legend.Xml); // Sourceman: seems to be necessary to keep track of the order of elements as defined in the schema (Word 2013) ChartRootXml.Element(XName.Get("plotArea", DocX.c.NamespaceName)).AddAfterSelf(Legend.Xml); }