Data Binding

25 Feb 20195 minutes to read

Bullet Graph supports binding JSON data from a remote server or data created in client-side. You can use the Fields property to customize the data bound with Bullet Graph.

Local Data

Data available in client-side (local data) can be bound with Bullet Graph using Fields property. This property provides option to specify data source, fields representing progress measure bar value, comparative measure value and category value.

    public class BulletData


        public double BulletValue

        { get; set; }

        public double ComparisonValue

        { get; set; }

        public string Category

        { get; set; }


            List<BulletData> data = new List<BulletData>();

            data.Add(new BulletData() { BulletValue=9.5, ComparisonValue=7.5, Category="2001"  });

            data.Add(new BulletData() { BulletValue = 9.5, ComparisonValue = 5, Category = "2002" });

            this.BulletGraph1.DataSource = data;

<ej:BulletGraph ID="BulletGraph1" Width="600px" Height="120px" runat="server">


                <Location X="50" Y="20" />


            <Fields CategoryField="Category" ComparativeMeasureField="ComparisonValue" FeatureMeasureField="BulletValue" />


The following screenshot displays Bullet Graph with local data generated in code-behind.

Remote Data

Bullet Graph provides option to bind data from a remote server using ejDataManager as data source in fields property. A query object should also be passed to query property when using data manager as data source.

  • HTML
  • <ej:BulletGraph ID="BulletGraph1" QualitativeRangeSize="60" Width="600px" Height="120px" runat="server">
                <QuantitativeScaleSettings Minimum="5" Maximum="45" Interval="10">
                    <Location X="50" Y="20" />
                    <ej:QualitativeRanges RangeEnd="25" />
                    <ej:QualitativeRanges RangeEnd="37" />
                    <ej:QualitativeRanges RangeEnd="45" />
                <Fields CategoryField="ProductID" ComparativeMeasureField="Quantity" FeatureMeasureField="UnitPrice" />
            <script type="text/javascript">
                //Creating data manager instance
                var dataManger = new ej.DataManager({
                    url: ""
                // Query creation
                var query = ej.Query().from("Order_Details").take(3).where("UnitPrice", ej.FilterOperators.greaterThan, 18, false)
                    .where("UnitPrice", ej.FilterOperators.lessThanOrEqual, 40, false)
                    .where("Quantity", ej.FilterOperators.greaterThan, 5, false)
                    .where("Quantity", ej.FilterOperators.lessThanOrEqual, 45, false);
                    fields: {
                        dataSource: dataManger,
                        query: query,

    The following screenshot displays a Bullet Graph bounded with data from a remote server