Hi,
i've been working the whole day on finding out how to check if the values
have -777 and replacing it with null value. I made that work (with help of
asp.net forums)...BUT...there is a problem.
I think we need to change that in Javascript, because if I change it in C#
part, i can only change n-1 rows. For example, if i check and replace with
nulls four out of four columns, the chart doesn't show, if i leave the last
column not-null the chart shows. If i check the code in Console
(shift+ctrl+j) i get the error :
Uncaught Error: Row given with size different than 6 (the number of columns
in the table).
If i check Source the Array looks like this, when replaced with nulls :
[new Date(2013, 0, 18, 14, 0, 0), , , , , ]
And where values are not null, the array looks like that :
[new Date(2013, 0, 18, 16, 0, 0), 268.14, 270.09, 270.55, 268.55, 259.3]
It certainly has something to do with the last value when it is changed to
NULL. I tried changing it to NULL also in SQL Server and importing such
values. The result was the same.
This is the code i used to replace the -777 values :
{
//Converts your object into a DateTime (so that it's
properties can be accessed properly
DateTime yourDate = Convert.ToDateTime(row["Datum"]);
if (Convert.ToString(row["MPT11"]) == "-777")
{row["MPT11"]= DBNull.Value;}
if (Convert.ToString(row["MPT12"]) == "-777")
{row["MPT12"]= DBNull.Value;}
if (Convert.ToString(row["MPT2"]) == "-777") {row["MPT2"]=
DBNull.Value;}
if (Convert.ToString(row["MPT31"]) == "-777")
{row["MPT31"]= DBNull.Value;}
if (Convert.ToString(row["MPT32"]) == "-777")
{row["MPT32"]= DBNull.Value;}
rowsList.Add("[new Date(" + yourDate.Year + ", " +
(yourDate.Month - 1) + ", " + yourDate.Day + ", " + yourDate.Hour + ", " +
yourDate.Minute + ", " + yourDate.Second + "), "
+ row["MPT11"] + ", "
+ row["MPT12"] + ", "
+ row["MPT2"] + ", "
+ row["MPT31"] + ", "
+ row["MPT32"] + "]");
Any ideas? could that also be because of regional settings (bTW , this is on
local machine, not server).
thanks, m
On Tuesday, 5 March 2013 01:06:54 UTC+1, asgallant wrote:
>
> You would want to check before adding to the rowsList. It could also be
> done in javascript, but it is probably easier to do in the server-side code.
>
> On Monday, March 4, 2013 4:04:45 PM UTC-5, Matevz Uros Pavlic wrote:
>>
>> What do you mean manually?
>> I'd like to write a If sentence which would check if there is -777 and
>> write null instead. But i don't understand where in my code should i do
>> this, because i have a rowsList that adds all the rows in a Array.
>>
>>
>>
>> On Monday, 4 March 2013 21:53:38 UTC+1, asgallant wrote:
>>>
>>> Yes, you can use nulls in the chart, but you will have to translate
>>> "-777" into null manually.
>>>
>>> On Monday, March 4, 2013 3:28:28 PM UTC-5, Matevz Uros Pavlic wrote:
>>>>
>>>> i have another problem regarding chart data. In SQL i have stored some
>>>> null data, which are marked as -777. Is it possible to not use this data
>>>> in
>>>> charts and use NULL instead?
>>>>
>>>> On Monday, 4 March 2013 21:16:09 UTC+1, Matevz Uros Pavlic wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> the second option sounds way easier ;) . I'll check it out...
>>>>> thanks
>>>>>
>>>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.