[7849] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Text;
|
---|
| 4 | using JsonFx.Json;
|
---|
| 5 |
|
---|
| 6 | namespace OpenFlashChart
|
---|
| 7 | {
|
---|
| 8 | //{
|
---|
| 9 | // shadow: true,
|
---|
| 10 | // rounded: 1,
|
---|
| 11 | // stroke: 2,
|
---|
| 12 | // colour: '#808080',
|
---|
| 13 | // background: '#f0f0f0',
|
---|
| 14 | // title: "color: #0000F0; font-weight: bold; font-size: 12;",
|
---|
| 15 | // body: "color: #000000; font-weight: normal; font-size: 12;",
|
---|
| 16 | // mouse: Tooltip.CLOSEST,
|
---|
| 17 | // text: "_default"
|
---|
| 18 | //}
|
---|
| 19 | public class ToolTip
|
---|
| 20 | {
|
---|
| 21 | string text="_default";
|
---|
| 22 | private bool shadow=true ;
|
---|
| 23 | private int rounded=1;
|
---|
| 24 | private int stroke = 2;
|
---|
| 25 | private string colour;//= "#808080";
|
---|
| 26 | private string background;//= "#f0f0f0";
|
---|
| 27 | private string titlestyle;// = "color: #0000F0; font-weight: bold; font-size: 12;";
|
---|
| 28 | private string bodystyle;//= "color: #000000; font-weight: normal; font-size: 12;";
|
---|
| 29 | private ToolTipStyle mousestyle;//= ToolTipStyle.CLOSEST;
|
---|
| 30 |
|
---|
| 31 | public int mouse;
|
---|
| 32 |
|
---|
| 33 | public ToolTip(string text)
|
---|
| 34 | {
|
---|
| 35 | this.text = text;
|
---|
| 36 | }
|
---|
| 37 | [JsonProperty("text")]
|
---|
| 38 | public String Text
|
---|
| 39 | {
|
---|
| 40 | get { return text; }
|
---|
| 41 | set { text = value; }
|
---|
| 42 | }
|
---|
| 43 | [JsonProperty("shadow")]
|
---|
| 44 | public bool Shadow
|
---|
| 45 | {
|
---|
| 46 | get { return shadow; }
|
---|
| 47 | set { shadow = value; }
|
---|
| 48 | }
|
---|
| 49 | [JsonProperty("rounded")]
|
---|
| 50 | public int Rounded
|
---|
| 51 | {
|
---|
| 52 | get { return rounded; }
|
---|
| 53 | set { rounded = value; }
|
---|
| 54 | }
|
---|
| 55 | [JsonProperty("stroke")]
|
---|
| 56 | public int Stroke
|
---|
| 57 | {
|
---|
| 58 | get { return stroke; }
|
---|
| 59 | set { stroke = value; }
|
---|
| 60 | }
|
---|
| 61 | [JsonProperty("colour")]
|
---|
| 62 | public string Colour
|
---|
| 63 | {
|
---|
| 64 | get { return colour; }
|
---|
| 65 | set { colour = value; }
|
---|
| 66 | }
|
---|
| 67 | [JsonProperty("background")]
|
---|
| 68 | public string BackgroundColor
|
---|
| 69 | {
|
---|
| 70 | get { return background; }
|
---|
| 71 | set { background = value; }
|
---|
| 72 | }
|
---|
| 73 | [JsonProperty("title")]
|
---|
| 74 | public string TitleStyle
|
---|
| 75 | {
|
---|
| 76 | get { return titlestyle; }
|
---|
| 77 | set { titlestyle = value; }
|
---|
| 78 | }
|
---|
| 79 | [JsonProperty("body")]
|
---|
| 80 | public string BodyStyle
|
---|
| 81 | {
|
---|
| 82 | get { return bodystyle; }
|
---|
| 83 | set { bodystyle = value; }
|
---|
| 84 | }
|
---|
| 85 | [JsonIgnore]
|
---|
| 86 | public ToolTipStyle MouseStyle
|
---|
| 87 | {
|
---|
| 88 | get { return mousestyle; }
|
---|
| 89 | set { mousestyle = value;
|
---|
| 90 | mouse = (int) value;
|
---|
| 91 | }
|
---|
| 92 | }
|
---|
| 93 | public void SetProximity()
|
---|
| 94 | {
|
---|
| 95 | mouse = 1;
|
---|
| 96 | }
|
---|
| 97 | public override string ToString()
|
---|
| 98 | {
|
---|
| 99 | return this.text;
|
---|
| 100 | }
|
---|
| 101 | }
|
---|
| 102 | public enum ToolTipStyle
|
---|
| 103 | {
|
---|
| 104 | CLOSEST=0,
|
---|
| 105 | FOLLOW=1,
|
---|
| 106 | NORMAL=2
|
---|
| 107 | }
|
---|
| 108 | }
|
---|