ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  About the Interactive Financial Chart
Posted by Ahmed Soliman on Jul-24-2014 22:36
Attachments:
Welcome i try to use "Interactive Financial Chart" and i replace the values of the arrays:

    $timeStamps = $db->getTimeStamps();
    $highData = $db->getHighData();
    $lowData = $db->getLowData();
    $openData = $db->getOpenData();
    $closeData = $db->getCloseData();
    $volData = $db->getVolData();

Is there a conditions for num of values and Disparity organized between the numbers for
showing a right draws ? I want just to try:

Why the non-commented numbers works and commented not works

File attaches for an example numeric.

Thanks
example.php
<?php

/* $timeStamps = array(644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200, 644191200);
  $highData = array (992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092);
  $lowData = array (900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000);
  $openData = array (880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985);
  $closeData = array (992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092);
  $volData = array (1000000, 2000000, 3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000, 11000000, 12000000, 13000000, 14000000, 15000000, 16000000, 17000000, 18000000, 19000000, 20000000, 21000000, 22000000, 23000000, 24000000, 25000000, 26000000, 27000000, 28000000, 29000000, 30000000, 31000000, 32000000, 33000000, 34000000, 35000000, 36000000, 37000000, 38000000, 39000000, 40000000, 41000000, 42000000, 43000000, 44000000, 45000000, 46000000, 47000000, 48000000, 49000000, 50000000, 51000000, 52000000, 53000000, 54000000, 55000000, 56000000, 57000000, 58000000, 59000000, 60000000, 61000000, 62000000, 63000000, 64000000, 65000000, 66000000, 67000000, 68000000, 69000000, 70000000, 71000000, 72000000, 73000000, 74000000, 75000000, 76000000, 77000000, 78000000, 79000000, 80000000, 81000000, 82000000, 83000000, 84000000, 85000000, 86000000, 87000000, 88000000, 89000000, 90000000, 91000000, 92000000, 93000000, 94000000, 95000000, 96000000, 97000000, 98000000, 99000000, 100000000); */

$timeStamps = array(63520968600, 63521055000, 63521141400, 63521227800, 63521314200, 63521573400, 63521659800, 63521746200, 63521832600, 63521919000, 63522178200, 63522264600, 63522351000, 63522437400, 63522523800, 63522783000, 63522869400, 63522955800, 63523042200, 63523128600, 63523387800, 63523474200, 63523560600, 63523647000, 63523733400, 63523992600, 63524079000, 63524165400, 63524251800, 63524338200, 63524597400, 63524683800, 63524770200, 63524856600, 63524943000, 63525202200, 63525288600, 63525375000, 63525461400, 63525547800, 63525807000, 63525893400, 63525979800, 63526066200, 63526152600, 63526411800, 63526498200, 63526584600, 63526671000, 63526757400, 63527016600, 63527103000, 63527189400, 63527275800, 63527362200, 63527621400, 63527707800, 63527794200, 63527880600, 63527967000, 63528226200, 63528312600, 63528399000, 63528485400, 63528571800, 63528831000, 63528917400, 63529003800, 63529090200, 63529176600, 63529435800, 63529522200, 63529608600, 63529695000, 63529781400, 63530040600, 63530127000, 63530213400, 63530299800, 63530386200, 63530645400, 63530731800, 63530818200, 63530904600, 63530991000, 63531250200, 63531336600, 63531423000, 63531509400, 63531595800, 63531855000, 63531941400, 63532027800, 63532114200, 63532200600, 63532459800, 63532546200, 63532632600, 63532719000, 63532805400, 63533064600, 63533151000, 63533237400, 63533323800, 63533410200, 63533669400, 63533755800, 63533842200, 63533928600, 63534015000, 63534274200, 63534360600, 63534447000, 63534533400, 63534619800, 63534879000, 63534965400, 63535051800, 63535138200, 63535224600, 63535483800, 63535570200, 63535656600, 63535743000, 63535829400, 63536088600, 63536175000, 63536261400, 63536347800, 63536434200, 63536693400, 63536779800, 63536866200, 63536952600, 63537039000, 63537298200, 63537384600, 63537471000, 63537557400, 63537643800, 63537903000, 63537989400, 63538075800, 63538162200, 63538248600, 63538507800, 63538594200, 63538680600, 63538767000, 63538853400, 63539112600, 63539199000, 63539285400, 63539371800, 63539458200, 63539717400, 63539803800, 63539890200, 63539976600, 63540063000, 63540322200, 63540408600, 63540495000, 63540581400, 63540667800, 63540927000, 63541013400, 63541099800, 63541186200, 63541272600, 63541531800, 63541618200, 63541704600, 63541791000);
$highData = array(1002, 1003, 991, 999, 1003, 1025, 1030, 1057, 1072, 1069, 1064, 1052, 1083, 1085, 1081, 1078, 1056, 1057, 1044, 1047, 1050, 1046, 1023, 1014, 1000, 1017, 1012, 1004, 994, 1007, 1001, 997, 990, 985, 1011, 1036, 1021, 1022, 1040, 1052, 1061, 1061, 1072, 1058, 1077, 1078, 1076, 1055, 1083, 1059, 1046, 1031, 1018, 1022, 1030, 1039, 1064, 1071, 1095, 1121, 1125, 1130, 1111, 1097, 1077, 1087, 1123, 1128, 1116, 1079, 1087, 1074, 1081, 1080, 1075, 1095, 1080, 1049, 1063, 1063, 1057, 1031, 1031, 1039, 1049, 1055, 1072, 1087, 1077, 1068, 1088, 1057, 1052, 1074, 1056, 1048, 1029, 1036, 1037, 1050, 1062, 1097, 1101, 1108, 1118, 1138, 1156, 1158, 1135, 1141, 1137, 1156, 1165, 1178, 1183, 1192, 1210, 1226, 1211, 1227, 1209, 1200, 1197, 1212, 1196, 1191, 1175, 1194, 1190, 1195, 1184, 1167, 1153, 1143, 1142, 1132, 1113, 1129, 1137, 1135, 1136, 1130, 1116, 1136, 1138, 1140, 1153, 1163, 1154, 1154, 1196, 1184, 1139, 1141, 1162, 1147, 1158, 1181, 1193, 1199, 1206, 1197, 1200, 1190, 1204, 1204, 1175, 1176, 1193, 1220, 1198, 1213, 1197, 1199);
$lowData = array(968, 974, 973, 952, 973, 999, 998, 1026, 1038, 1036, 1037, 1035, 1046, 1059, 1054, 1050, 1018, 1042, 1027, 1019, 1028, 1017, 982, 990, 980, 962, 978, 975, 973, 971, 972, 968, 960, 960, 976, 1003, 999, 1003, 993, 1014, 1038, 1046, 1033, 1028, 1048, 1037, 1035, 1040, 1044, 1020, 1033, 1005, 985, 1010, 985, 998, 1024, 1040, 1066, 1082, 1090, 1094, 1083, 1085, 1057, 1053, 1086, 1093, 1079, 1040, 1062, 1042, 1050, 1038, 1058, 1070, 1038, 1024, 1028, 1025, 1022, 1005, 996, 1010, 1010, 1032, 1031, 1048, 1065, 1039, 1045, 1032, 1021, 1037, 1034, 1011, 1008, 997, 986, 1032, 1029, 1079, 1061, 1086, 1069, 1099, 1118, 1126, 1116, 1094, 1119, 1125, 1129, 1151, 1167, 1157, 1169, 1199, 1186, 1199, 1192, 1172, 1177, 1180, 1187, 1175, 1164, 1184, 1169, 1162, 1168, 1140, 1140, 1129, 1125, 1107, 1110, 1101, 1110, 1106, 1116, 1094, 1089, 1097, 1128, 1105, 1129, 1139, 1128, 1146, 1165, 1133, 1108, 1110, 1120, 1134, 1118, 1149, 1178, 1167, 1190, 1169, 1171, 1165, 1173, 1171, 1136, 1143, 1162, 1196, 1182, 1192, 1180, 1163);
$openData = array(1000, 991, 977, 964, 990, 1003, 1005, 1037, 1041, 1058, 1057, 1048, 1063, 1075, 1063, 1072, 1044, 1051, 1037, 1035, 1042, 1028, 1010, 1012, 987, 982, 997, 987, 976, 990, 982, 988, 971, 985, 990, 1008, 1021, 1013, 1006, 1029, 1054, 1053, 1059, 1033, 1069, 1051, 1063, 1053, 1072, 1043, 1042, 1024, 995, 1013, 1000, 1010, 1047, 1055, 1086, 1105, 1109, 1119, 1107, 1097, 1066, 1072, 1098, 1108, 1107, 1070, 1076, 1052, 1054, 1051, 1067, 1085, 1066, 1044, 1052, 1043, 1027, 1025, 1000, 1016, 1023, 1040, 1040, 1064, 1067, 1067, 1059, 1057, 1036, 1056, 1042, 1030, 1026, 1030, 1006, 1041, 1048, 1079, 1080, 1090, 1087, 1107, 1138, 1135, 1133, 1114, 1132, 1128, 1139, 1165, 1181, 1158, 1182, 1205, 1203, 1199, 1195, 1193, 1186, 1196, 1191, 1182, 1173, 1184, 1180, 1187, 1171, 1163, 1144, 1141, 1130, 1115, 1110, 1118, 1114, 1123, 1128, 1111, 1094, 1106, 1134, 1128, 1136, 1149, 1149, 1147, 1167, 1166, 1134, 1133, 1145, 1143, 1132, 1152, 1178, 1180, 1201, 1177, 1173, 1174, 1187, 1193, 1167, 1159, 1169, 1199, 1193, 1192, 1193, 1181);
$closeData = array(981, 993, 977, 984, 990, 1015, 1021, 1049, 1056, 1053, 1056, 1047, 1075, 1074, 1069, 1059, 1035, 1043, 1037, 1034, 1042, 1026, 993, 992, 990, 1000, 989, 994, 988, 999, 993, 990, 982, 972, 996, 1017, 1005, 1018, 1024, 1038, 1055, 1054, 1040, 1050, 1056, 1061, 1049, 1054, 1054, 1035, 1044, 1014, 1008, 1015, 1011, 1029, 1035, 1067, 1085, 1097, 1108, 1101, 1097, 1085, 1068, 1078, 1118, 1103, 1089, 1058, 1070, 1062, 1065, 1062, 1066, 1077, 1053, 1038, 1035, 1046, 1042, 1005, 1016, 1029, 1040, 1042, 1055, 1080, 1066, 1058, 1072, 1043, 1048, 1040, 1041, 1020, 1020, 1015, 1021, 1041, 1061, 1093, 1098, 1103, 1099, 1124, 1137, 1150, 1127, 1126, 1136, 1138, 1154, 1173, 1170, 1172, 1199, 1218, 1208, 1211, 1196, 1189, 1181, 1209, 1189, 1179, 1167, 1189, 1174, 1177, 1169, 1146, 1142, 1132, 1126, 1111, 1112, 1119, 1125, 1133, 1119, 1100, 1104, 1123, 1131, 1123, 1132, 1153, 1137, 1151, 1184, 1152, 1117, 1126, 1133, 1135, 1146, 1163, 1186, 1197, 1191, 1183, 1185, 1188, 1178, 1175, 1154, 1163, 1181, 1210, 1190, 1207, 1184, 1172);
$volData = array(1189685.4067896, 1784053.2542402, 691819.2110471, 1930777.7442575, 1933241.1623172, 2211311.3225697, 2209921.940628, 1369703.7568478, 1511571.9826453, 1545255.9057263, 571614.28687899, 2064857.1009666, 869521.29434085, 598948.59699974, 1699990.5764125, 2327617.3579105, 1178403.9476603, 720297.89076659, 1623260.8964488, 1401585.8608535, 1376041.0535326, 1918528.8742693, 1846790.2139171, 672676.1861175, 2006713.1015255, 2265561.0772235, 1513952.5134615, 843915.5585002, 696503.50422517, 1892936.615132, 618352.42484658, 815119.88079062, 1124412.115343, 2069497.6429384, 1764502.0739326, 1571883.1352591, 2199294.347246, 873479.61691522, 1837917.2038608, 1658701.807996, 1024672.5935779, 1459548.3092031, 1097371.3376088, 1118420.8771722, 849840.11490593, 1309290.2099735, 934023.98760291, 500931.91815562, 1134666.0597796, 2185657.0238447, 1542976.3330712, 1461576.1602674, 1099796.6324444, 2400329.0869064, 1487872.1071845, 2230339.6877205, 681031.23832984, 725878.73559116, 1627079.7595212, 2274753.8098541, 651211.64316107, 1770398.7744801, 528713.16625474, 2293050.3575581, 1444333.0375814, 2041042.9517601, 877200.69856783, 2292417.8526253, 1358626.2927527, 1349881.0848337, 1952619.0649375, 1246492.1299244, 1050216.0304576, 797793.34466387, 2399666.8243547, 1600744.5964731, 1209914.7021561, 894401.77157391, 2122659.3432069, 877427.41647582, 1342408.7755481, 2088368.8003729, 2229423.601583, 1769897.824449, 2186342.1270825, 2270066.7455257, 1717096.7010821, 2148599.9570341, 1274989.3136264, 780824.4936822, 559917.46533194, 2118096.0847107, 841885.14303926, 1079280.5581771, 1487352.0911176, 1873876.2096907, 1935741.4807742, 2472528.9042044, 2411328.3981363, 1341403.3541552, 2254168.4586914, 1722041.30963, 2267503.5572069, 2317376.1246301, 1706398.6736365, 2472522.3374489, 1856644.6852304, 1460775.5343804, 1294627.6484976, 545592.43844021, 1271598.5939772, 720925.01544881, 1667726.3731062, 1643675.5352522, 2277503.5490695, 2298156.9407969, 1234742.6076268, 1017817.3446371, 1761089.3503905, 1681046.9220348, 1408358.7906576, 637165.58230509, 767392.22655711, 610056.74025744, 1747191.2045142, 1264490.0639459, 1249371.5553427, 1902270.6866735, 1768570.5323863, 1293766.4545127, 1487809.5381399, 2133930.6062166, 1122006.7694369, 1843371.4363126, 2238907.6281662, 1546803.4802579, 904624.75884813, 1774570.0379076, 1308672.5256426, 1409949.0840244, 1330325.4383687, 1951080.9363451, 1104886.2674751, 2062421.6095457, 2193303.7577414, 546033.81223186, 2182368.2272067, 1528975.2523017, 1469927.9952259, 769055.36518177, 1467825.7277626, 732654.69964423, 690707.88756728, 1200867.0164973, 1109767.0389828, 514362.92892656, 1447536.6107532, 637890.50563655, 1124292.7989513, 2335260.388403, 1985886.6356048, 1273757.4825934, 2095948.5130375, 619496.92576181, 2427626.5525091, 1673287.001246, 2055906.6556291, 689593.79293714, 2143290.9950715, 1608019.0686295, 2419841.4464295, 747487.00164433, 752357.90020143, 1581957.7684351);
?>

  Re: About the Interactive Financial Chart
Posted by Peter Kwan on Jul-24-2014 23:34
Hi Ahmed,

I have tried your data in the "Finance Chart (1)" sample code, and it works.

In the "Interactive Financial Chart" sample code, there is a user interface on the left side
that allows the user to enter the "ticker symbol", select the time period, indicator types,
etc.. For example, if the user selects to display the last 6 months of data (6 months in
the user interface means last 6 months in the sample code), then it will plot the chart
using the last 6 months of data. If your data are not for the last 6 months, the sample
code will display "No data available for the specified time period".

You can check the sample code. At around line 327, there is a line "if ($timeStamps[$i]
>= $startDate)", which checks if the data are earlier than the specified time range and
remove it from plotting (by considering they are "extra points" not to be plotted). Then
following that, the code will check if all the data points have been extra points (so no
points will be plotted). If this is the case, it will display "No data available for the
specified time period".

For your case, your data likely are not in the specified time period, so it is normal that
the chart will not be plotted.

Note that in ChartDirector for PHP, the timestamps have to be specified as calendar
seconds elapsed since Jan 01, 0001 00:00:00. You can create such as number using
chartTime or chartTime2. See:

http://www.advsofteng.com/doc/cdphp.htm#dateformat.htm

Hope this can help.

Regards
Peter Kwan