RangeMarker.cs :  » Charting-Reporting-Tools » googlechartsharp » GoogleChartSharp » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Charting Reporting Tools » googlechartsharp 
googlechartsharp » GoogleChartSharp » RangeMarker.cs
using System;
using System.Collections.Generic;
using System.Text;

namespace GoogleChartSharp{
    public class RangeMarker
    {
        private RangeMarkerType type;
        public RangeMarkerType Type
        {
            get { return type; }
            set { type = value; }
        }

        private string color;
        /// <summary>
        /// an RRGGBB format hexadecimal number.
        /// </summary>
        public string Color
        {
            get { return color; }
            set { color = value; }
        }

        private double startPoint;
        /// <summary>
        /// for horizontal range markers is the position on the y-axis at which the range starts where 0.00 is the bottom and 1.00 is the top.
        /// for vertical range markers is the position on the x-axis at which the range starts where 0.00 is the left and 1.00 is the right.
        /// </summary>
        public double StartPoint
        {
            get { return startPoint; }
            set { startPoint = value; }
        }

        private double endPoint;
        /// <summary>
        /// for horizontal range markers is the position on the y-axis at which the range ends where 0.00 is the bottom and 1.00 is the top.
        /// for vertical range markers is the position on the x-axis at which the range ends where 0.00 is the left and 1.00 is the right.
        /// </summary>
        public double EndPoint
        {
            get { return endPoint; }
            set { endPoint = value; }
        }

        /// <summary>
        /// Create a range marker for line charts and scatter plots
        /// </summary>
        /// <param name="rangeMarkerType"></param>
        /// <param name="color">an RRGGBB format hexadecimal number</param>
        /// <param name="startPoint">Must be between 0.0 and 1.0. 0.0 is axis start, 1.0 is axis end.</param>
        /// <param name="endPoint">Must be between 0.0 and 1.0. 0.0 is axis start, 1.0 is axis end.</param>
        public RangeMarker(RangeMarkerType rangeMarkerType, string color, double startPoint, double endPoint)
        {
            this.type = rangeMarkerType;
            this.color = color;
            this.startPoint = startPoint;
            this.endPoint = endPoint;
        }

        public string GetTypeUrlChar()
        {
            switch (this.type)
            {
                case RangeMarkerType.Horizontal:
                    return "r";
                case RangeMarkerType.Vertical:
                    return "R";
            }
            return null;
        }

        public string GetUrlString()
        {
            string s = string.Empty;
            s += GetTypeUrlChar() + ",";
            s += color + ",";
            // this value is ignored - but has to be a number
            s += "0" + ",";
            s += startPoint.ToString() + ",";
            s += endPoint.ToString();
            return s;
        }
    }

    public enum RangeMarkerType
    {
        /// <summary>
        /// A horizontal band across the chart area
        /// </summary>
        Horizontal,

        /// <summary>
        /// A vertical band across the chart area
        /// </summary>
        Vertical
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.