# How can I create an interactive application that accepts data and and plots it?

I have some code in Mathematica which shows a colored plot, where the coloring depends on data values. I would like to make this into an interactive application that accepts two inputs:

1. data, a list of data points.
2. PocetDat, an integer parameter.

I know little about CDF, but i don't see how I can get inputs or table inputs from the users. Further, I want the users of the application to only see the inputs and the final plot -- no code.

data =
{-0.003, 0.002, 0.008, 0.014, -0.026, -0.036, -0.042, -0.010, -0.000,
-0.014, -0.013,  0.048, 0.014, -0.035, -0.023, 0.025, 0.001, -0.002,
0.050, 0.053,  0.031, -0.045, 0.003, 0.052, 0.066, -0.040,  0.016,
-0.054, -0.040, -0.042, -0.018, -0.034, -0.032, -0.021,  0.008, -0.007};
PocetDat = 912;
KorelCiara = 2*Sqrt[1/PocetDat];
PRange = 1.2*Max[{data, KorelCiara}];
Show[
DiscretePlot[data[[i]], {i, 1, Length[data]},
ExtentSize -> Full,
ColorFunction -> Function[x, If[Abs[data[[x]]] > KorelCiara, Red, Blue]],
ColorFunctionScaling -> False],
Plot[{KorelCiara, -KorelCiara}, {x, 0, Length[data]}],
PlotRange -> {-PRange, PRange}]

• But with .cdf's there are restrictions: you cannot use input fields and cannot read from files. What you can do is to import data from a (publicly accessible) website. This may be the best option. Dec 15, 2013 at 7:06
• I want to do something like that: secretzone.sktipy.sk/data.php Paste in Input some values from Excel .. it transforms to Mathematica table and I can working with this numbers. As user you know nothing what code do - i can count basic sums or else .. and this i like to do with Mathematica - have 1 input, button to start and after user saved some values it compute something. Dec 15, 2013 at 9:01

But I think your case is very simple. You just need data input from user in the typical Manipulate interface. There are many ways to do this - especially for pure numerical values. But you have to think about convenience for users of the process of data entry. My favorite method is Locator - because it is interactive and editable. Demonstration Project has many examples to offer, you should search there, but 1st consider examples I give below. There are other ways of course. Consider for example a Slider and then 2 buttons to add and delete a point. Slider itself is better than InputField IMHO because it already has input field built-in