Chart / Commanding / Ribbon / Chart Ribbon Overview
In This Topic
    Chart Ribbon Overview
    In This Topic

    NOV Chart for .NET provides a lot of commands and settings most of which can be shown to the end user in a ribbon interface. There are two ways to create a ribbon associated with a chart view:

     Chart View with Ribbon Control

    If you are not creating a cross-platform application, the easiest way to create a chart view with ribbon is to use the Visual Studio designer and drop an NChartViewWithRibbonControl from the Visual Studio toolbox to your form/window.

    Alternatively, you can use the NChartViewWithRibbon class to add a chart view with ribbon to your form/window programmatically. The example below demonstrates how to create a chart view with ribbon hosted in a NOV widget host. You can then add this host to the form's Controls collection if you are creating a WinForms application, set it as the Content of a WPF window in a WPF application project or to the ContentView of a Xamarin.Mac window:

    Create a chart view with ribbon
    Copy Code
    NChartViewWithRibbon chartViewWithRibbon = new NChartViewWithRibbon(); // Create a chart view with ribbon
    NChartView chartView = chartViewWithRibbon.View; // Get the chart view
    
    // Create a NOV widget host that hosts the chart view with a ribbon
    NNovWidgetHost<NWidget> novHost = new NNovWidgetHost<NWidget>(chartViewWithRibbon);
    
     Chart Ribbon Builder

    NOV Chart provides a ribbon builder that can be used to create and associate ribbon commanding UI to a chart view. The builder is represented by the NChartRibbonBuilder class.

    The following code fragment demonstrates how to create a ribbon-based commanding UI using a chart ribbon builder and associate it with a chart view:

    Create ribbon UI using a ribbon builder
    Copy Code
    NDiagramRibbonBuilder ribbonBuilder = new NDiagramRibbonBuilder();
    NCommandUIHolder chartViewWithRibbon = ribbonBuilder.CreateUI(drawingView);
    
    See Also