[]
The quick start guides you through the steps of adding a BulletGraph control to your MVC web application and set its value. For information on how to add a control, See Adding controls.
Follow the steps given below to get started:
Create a new MVC application using the ComponentOne or VisualStudio templates. For more information about creating an MVC application, see Configuring your MVC Application topic.
Add a new Controller:
Default1Controller
).Add a View for the controller:
Default1Controller
) to open it.Index()
.Add a Model
Models are required to fetch data for the controls.
Class1.cs
).From the Solution Explorer, expand the folder Views.
Double click Index.cshtml
to open it.2. Replace the default code of the Index.cshtml
file with the code given below to initialize a BulletGraph control and set the following properties:
[Max](/componentone/api/mvc/online-mvc-core/dotnet-api/C1.AspNetCore.Mvc/C1.Web.Mvc.Gauge.Max.html)
properties to 0 and 100 respectively. The Min and Max properties specify the range of the gauge. You can add multiple ranges to a single gauge.<c1-bullet-graph min=0 max=100 good=60 bad=40 value=50 target=70 width="500px"
is-read-only="false" step="1" is-animated="true">
</c1-bullet-graph>
type=note
Append the folder name and view name to the generated URL (for example: http://localhost:1234/Default1/index) in the address bar of the browser to see the view. Or link the view to the home page.