Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
You have to be more specific.
Where is the input and where is the output in your schematic?
What is the input signal? Sine or squarewawe or other?
I would recommend you use a spice simulator to simulate the circuit, then you can watch the signals yourself.
The diode is reverse biased when the switch is closed and so with an ideal diode you get the full 10 V on the output. (If the diode were not ideal, you would get the 10 V minus the diode leakage current drawn through the resistor.) If the diode was the other direction, the output would be the diode forrward drop plus the voltage on the capacitor. The voltage would rise to 10 V with a time constant of RC and you would end up with all 10 V on the capacitor because the diode forward drop at low currents approaching zero is itself nearly zero.
This circuit will follow the graph you show only when the capacitor has a voltage on it and only for a short time because the voltage will change when the capacitor is discharged. A better form of this circuit is to have a DC source where the capacitor is now.